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

Lexical colorization/classification for template strings. #2026

Merged
merged 10 commits into from
Feb 13, 2015

Conversation

DanielRosenwasser
Copy link
Member

Follow up to #1744 but for TypeScript 1.5.

This PR adds lexical classification support for template strings in the absence of a syntactic classifier.

It will break in the presence of

  • Nested template strings that span multiple lines.
  • Nested expressions composed of curly braces, where the closing curly falls on the next line.

But otherwise it is a fairly good approximation.

@@ -1168,7 +1171,7 @@ module ts {
}

export interface Classifier {
getClassificationsForLine(text: string, lexState: EndOfLineState, classifyKeywordsInGenerics?: boolean): ClassificationResult;
getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): ClassificationResult;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment the purpose of this parameter so that consumers of the LS know what they should pass and how hte classifiers interact

DanielRosenwasser added a commit that referenced this pull request Feb 13, 2015
Lexical colorization/classification for template strings.
@DanielRosenwasser DanielRosenwasser merged commit efed5f0 into master Feb 13, 2015
@DanielRosenwasser DanielRosenwasser deleted the lexicalTemplateStringsOnMaster branch February 13, 2015 22:07
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants