Comments (6)
Please provide steps to reproduce the issue.
from typescript-language-server.
And what would you expect the type of foo
(const foo
) be if not a variable?
from typescript-language-server.
I don't see why it wouldn't be CompletionItemKind 21 "Constant", that makes the most sense
from typescript-language-server.
Server tries to match this VSCode code: https://github.com/microsoft/vscode/blob/428dd56479f4f9987fe0b0a444c11c46e84b2525/extensions/typescript-language-features/src/languageFeatures/completions.ts#L440-L499
As you see both here and there, the Constant
is used for string literal.
Constant wouldn't really be more correct as const foo
is still a variable, just of a const type. You can't satisfy everyone since it's only possible to describe the completion with a single type. And I would argue that it's more useful to see that the completion is a variable than that it has constant type.
from typescript-language-server.
I figured that was the reason, I think the completion item kind interface also more closesly matches with TypeScript's type rather than class but I understand you're trying to just match with VsCode as much as possible.
The other LSPs I've worked with (rust-analyzer, gopls) give a function signature or variable type in the item details as well as the import. Is there any appetite to have typescript-language-server function in the same way? I'm not familiar with the VsCode codebase but their completions do give the correct kind for types, const, let, etc. I'd be happy to implement this if so
from typescript-language-server.
I'm not familiar with the VsCode codebase but their completions do give the correct kind for types, const, let, etc. I'd be happy to implement this if so
What do you mean by that. I've said above that this project tries to match VSCode implementation so if it's not matching it then that would be a "bug".
from typescript-language-server.
Related Issues (20)
- Support renaming files when renaming default exports
- (bug) Closed document ownership not transferred back to the filesystem HOT 5
- Use diagnostic range when requesting `getCodeFixes` HOT 4
- checkJs on not respected with declaration files HOT 2
- Typescript Server Error when `includeInlayVariableTypeHints = true` and an arrow function is made. HOT 1
- Deprecated property not marked as such HOT 3
- problems with `interface` structure HOT 3
- How to Disable "Move to a new file" action? HOT 2
- typescript server error when using 'inlay hints' (Unexpected node.^M) HOT 1
- Debug Failure. Unexpected node. HOT 5
- env: node: No such file or directory on MacOS HOT 3
- SyntaxError: Unexpected token import HOT 1
- importModuleSpecifierEnding is not respected HOT 1
- Unable to initialize, language server cannot read properties of undefined (reading 'workspace') HOT 1
- Add Semantic Tokens for Template Literal Strings HOT 1
- Ignore typescript type errors in `.js` / `.jsx` files HOT 3
- neovide GUI "env: node: No such file or directory HOT 1
- Is it possible to filter build-in types? HOT 1
- Does not format .tsx files HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-language-server.