Skip to content
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

Improve semantic tokens for variables by splitting it up into more tokens #100

Closed
rcjsuen opened this issue Jan 22, 2022 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Jan 22, 2022

RUN ${var:+word}
const lib = require("dockerfile-language-service");
const service = lib.DockerfileLanguageServiceFactory.createLanguageService();
const tokens = service.computeSemanticTokens("RUN ${var:+word}");
console.log(tokens.data.length);
10

At the moment, 10 is printed which implies there are two tokens (each taking up five numbers in the array) with the RUN instruction as one token and ${var:+word} as one token. We should split the one variable token into five separate tokens like so:

  • ${var (variable)
  • : (operator)
  • + (modifier)
  • word (parameter)
  • } (variable)
@rcjsuen rcjsuen added the enhancement New feature or request label Jan 22, 2022
@rcjsuen rcjsuen self-assigned this Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant