Skip to content

Commit

Permalink
Merge pull request #746 from auduchinok/lexhelp-keywords
Browse files Browse the repository at this point in the history
Add wrappers for LexHelp.Keywords
  • Loading branch information
dsyme authored Apr 3, 2017
2 parents 1bd4ed3 + d19db74 commit 0e98fe8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/fsharp/vs/ServiceLexing.fs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ type FSharpSourceTokenizer(defineConstants : string list, filename : Option<stri
let lexbuf = UnicodeLexing.FunctionAsLexbuf bufferFiller
FSharpLineTokenizer(lexbuf, None, filename, lexArgsLightOn, lexArgsLightOff)

module Keywords =
open Microsoft.FSharp.Compiler.Lexhelp.Keywords

let QuoteIdentifierIfNeeded s = QuoteIdentifierIfNeeded s
let NormalizeIdentifierBackticks s = NormalizeIdentifierBackticks s
let KeywordsWithDescription = keywordsWithDescription

[<System.Obsolete("This type has been renamed to FSharpSourceTokenizer")>]
type SourceTokenizer = FSharpSourceTokenizer

Expand Down
11 changes: 10 additions & 1 deletion src/fsharp/vs/ServiceLexing.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,14 @@ type FSharpSourceTokenizer =


module internal TestExpose =
val TokenInfo : Parser.token -> (FSharpTokenColorKind * FSharpTokenCharKind * FSharpTokenTriggerClass)
val TokenInfo : Parser.token -> (FSharpTokenColorKind * FSharpTokenCharKind * FSharpTokenTriggerClass)

module Keywords =
/// Add backticks if the identifier is a keyword.
val QuoteIdentifierIfNeeded : string -> string

/// Remove backticks if present.
val NormalizeIdentifierBackticks : string -> string

/// Keywords paired with their descriptions. Used in completion and quick info.
val KeywordsWithDescription : (string * string) list

0 comments on commit 0e98fe8

Please sign in to comment.