question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SemanticTokenTypes.type is ambigious

See original GitHub issue

I think type might mean either of these three different things:

  • type alias, like type Foo = (); or typedef int uint32_t;
  • type reference, like let x: (i32, i32) = (0, 0) or int x = 92;
  • type as a modifier: structs, interfaces, enums are “types”

I suggest renaming it to typeAlias / typedef, as that is much more specific, and probably the most useful one.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
aeschlicommented, Feb 27, 2020

type is intended to be the super type of all types. In VSCode we map type to TextMate scope entity.name.type We can also add typeAlias, if there are multiple languages can use it. But that said, language servers are free to come up with their own custom token types. The plan is to introduce a naming convention for custom token types such astype>typeAlias to signal that typeAlias is extending type.

0reactions
dbaeumercommented, Oct 29, 2020

There are documented here https://github.com/microsoft/vscode-languageserver-node/blob/master/protocol/src/common/protocol.semanticTokens.ts#L18 and in the 3.16.0 spec. I will add something for the type value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

metaphysics - Why do we have type-token ambiguity?
1 Answer 1 ... "Why do we struggle to separate the idea of a type from a token?" Well, in ordinary language, there...
Read more >
Proper way to handle ambiguous tokens in PLY - Stack Overflow
Is there any need for the tokenizer to distinguish between variables, numbers, field references and tag references?
Read more >
Some Types of Ambiguous Tokens - JSTOR
SOME TYPES OF AMBIGUOUS TOKENS'. By J. A. FODOR and R. B. FREED ... and J. A. Fodor, " The Structure of a...
Read more >
Semantic Highlight Guide | Visual Studio Code Extension API
Each token returned by the provider comes with a classification that consists of a token type, any number of token modifiers, and a...
Read more >
Type–token distinction - Wikipedia
The type–token distinction is the difference between naming a class (type) of objects and naming the individual instances (tokens) of that class.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found