rcjsuen / dockerfile-language-service

Dockerfile language service for providing an API to create feature-rich Dockerfile editors in JavaScript.
MIT License
16 stars 2 forks source link

Provide API for retrieving semantic tokens of a range #66

Open rcjsuen opened 4 years ago

rcjsuen commented 4 years ago

Clients may want to only fetch the semantic tokens of the visible lines in the editor instead of the entire file. We should change the function of computeSemanticTokens so that it can optionally take a Range argument for faster processing.

https://github.com/rcjsuen/dockerfile-language-service/blob/3ea186ffff205faa084479145a6b4034a37cc8cd/src/main.ts#L127-L130

export interface DockerfileLanguageService { {
    computeSemanticTokens(content: string, range?: Range): SemanticTokens; 
}