angular / vscode-ng-language-service

Angular extension for Visual Studio Code
MIT License
773 stars 116 forks source link

refactor(client): use `SourceFile` to detect the Angular context in t… #2027

Closed ivanwonder closed 4 months ago

ivanwonder commented 4 months ago

…he client

When using the typescript's scanner to parse the template literals which includes an expression, knowing the right CloseBraceToken of the expression to invoke the reScanTemplateToken function is a little complex. If don't do this, the rest of the file is temporarily "poisoned".

There is an explanation for why typescript's fast-acting lexical classifications don't work for template sting across lines. https://github.com/microsoft/TypeScript/issues/1477#issuecomment-66907946 https://github.com/microsoft/TypeScript/blob/a4d12a46c8b413c65a730c4ad0323459f1fc44ce/src/services/classifier.ts#L114

So this PR uses the SourceFile to detect the Angular context in the client.

angular-automatic-lock-bot[bot] commented 3 months ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.