Closed rcjsuen closed 2 years ago
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:
RUN
${var:+word}
${var
:
+
word
}
At the moment,
10
is printed which implies there are two tokens (each taking up five numbers in the array) with theRUN
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)