-
Notifications
You must be signed in to change notification settings - Fork 13k
Filtered out types from import suggestions in JS files #53619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sandersn
merged 19 commits into
microsoft:main
from
JoshuaKGoldberg:no-types-in-esm-imports
Nov 16, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
bf9dd25
Filtered out types from import suggestions in JS files
JoshuaKGoldberg c7ff6b2
Account for JSDoc type locations in JS files
JoshuaKGoldberg 3773af1
Added a bit more to the test case
JoshuaKGoldberg 119a10b
Update src/services/completions.ts
JoshuaKGoldberg 1ab7b75
Post suggestion: remove unused function
JoshuaKGoldberg ae5fc3d
Correcting to !(symbol.flags & SymbolFlags.Value)
JoshuaKGoldberg b4b7b98
Went back to symbol check function
JoshuaKGoldberg be9fba8
Naming and comments
JoshuaKGoldberg dd9ff9b
Almost working with SymbolFlags.Value
JoshuaKGoldberg 336aaec
looking forward to dprint
JoshuaKGoldberg b8c99c2
Merge branch 'main'
JoshuaKGoldberg 012679f
Twitch review-as-a-service
JoshuaKGoldberg e344ec8
Added javascriptModulesTypeImport
JoshuaKGoldberg 5644a4f
Account for JS file type-only exports
JoshuaKGoldberg f30827c
Merge branch 'main'
JoshuaKGoldberg c1f7cb4
Merge branch 'main' into no-types-in-esm-imports
JoshuaKGoldberg 9eecdd5
Add a sub-namespace type, and undid some formatting changes
JoshuaKGoldberg 5bc890c
Merge branch 'main' into no-types-in-esm-imports
sandersn 8de257d
Remove unnecessary getSourceFile
JoshuaKGoldberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
// === Completions === | ||
=== /a.js === | ||
// import { } from './declarations.ts' | ||
// ^ | ||
// | ---------------------------------------------------------------------- | ||
// | class DeclaredClass | ||
// | const declaredVariable: number | ||
// | class TestClass | ||
// | class TestClassInterfaceMerged | ||
// | interface TestClassInterfaceMerged | ||
// | enum TestEnum | ||
// | function testFunction(): void | ||
// | namespace TestNamespaceWithValue | ||
// | const testValue: {} | ||
// | ---------------------------------------------------------------------- | ||
|
||
[ | ||
{ | ||
"marker": { | ||
"fileName": "/a.js", | ||
"position": 9, | ||
"name": "" | ||
}, | ||
"item": { | ||
"flags": 0, | ||
"isGlobalCompletion": false, | ||
"isMemberCompletion": true, | ||
"isNewIdentifierLocation": false, | ||
"entries": [ | ||
{ | ||
"name": "DeclaredClass", | ||
"kind": "class", | ||
"kindModifiers": "export,declare", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "class", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "DeclaredClass", | ||
"kind": "className" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "declaredVariable", | ||
"kind": "const", | ||
"kindModifiers": "export,declare", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "const", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "declaredVariable", | ||
"kind": "localName" | ||
}, | ||
{ | ||
"text": ":", | ||
"kind": "punctuation" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "number", | ||
"kind": "keyword" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "TestClass", | ||
"kind": "class", | ||
"kindModifiers": "export", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "class", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "TestClass", | ||
"kind": "className" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "TestClassInterfaceMerged", | ||
"kind": "class", | ||
"kindModifiers": "export", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "class", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "TestClassInterfaceMerged", | ||
"kind": "className" | ||
}, | ||
{ | ||
"text": "\n", | ||
"kind": "lineBreak" | ||
}, | ||
{ | ||
"text": "interface", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "TestClassInterfaceMerged", | ||
"kind": "className" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "TestEnum", | ||
"kind": "enum", | ||
"kindModifiers": "export", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "enum", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "TestEnum", | ||
"kind": "enumName" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "testFunction", | ||
"kind": "function", | ||
"kindModifiers": "export", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "function", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "testFunction", | ||
"kind": "functionName" | ||
}, | ||
{ | ||
"text": "(", | ||
"kind": "punctuation" | ||
}, | ||
{ | ||
"text": ")", | ||
"kind": "punctuation" | ||
}, | ||
{ | ||
"text": ":", | ||
"kind": "punctuation" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "void", | ||
"kind": "keyword" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "TestNamespaceWithValue", | ||
"kind": "module", | ||
"kindModifiers": "export", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "namespace", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "TestNamespaceWithValue", | ||
"kind": "moduleName" | ||
} | ||
], | ||
"documentation": [] | ||
}, | ||
{ | ||
"name": "testValue", | ||
"kind": "const", | ||
"kindModifiers": "export", | ||
"sortText": "11", | ||
"displayParts": [ | ||
{ | ||
"text": "const", | ||
"kind": "keyword" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "testValue", | ||
"kind": "localName" | ||
}, | ||
{ | ||
"text": ":", | ||
"kind": "punctuation" | ||
}, | ||
{ | ||
"text": " ", | ||
"kind": "space" | ||
}, | ||
{ | ||
"text": "{", | ||
"kind": "punctuation" | ||
}, | ||
{ | ||
"text": "}", | ||
"kind": "punctuation" | ||
} | ||
], | ||
"documentation": [] | ||
} | ||
] | ||
} | ||
} | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.