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

Incorrect number of tokens returned when string content is right before an escaped newline #114

Closed
rcjsuen opened this issue Jun 1, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Jun 1, 2023

RUN echo "test" a''\
# a'b
echo "test2"
const lib = require("dockerfile-language-service");
const service = lib.DockerfileLanguageServiceFactory.createLanguageService();
const tokens = service.computeSemanticTokens(`RUN echo "test" a''\\\n# a'b\necho "test2"`);
console.log(tokens["data"].length);
50

There should be 9 tokens in total (length of 45) but it looks like we have found 10 instead.

  1. RUN
  2. echo
  3. "test"
  4. a
  5. ''
  6. \
  7. # a'b
  8. echo
  9. "test2"
@rcjsuen rcjsuen added the bug Something isn't working label Jun 1, 2023
@rcjsuen rcjsuen self-assigned this Jun 1, 2023
@rcjsuen rcjsuen closed this as completed in c480cee Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant