Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit baa380b

Browse files
cartermpnosami
authored andcommitted
Replace (nearly) all ref cells in the compiler with mutable values (dotnet#8063)
* # This is a combination of 9 commits. # This is the 1st commit message: ref -> mutable in more places in the compiler # The commit message #2 will be skipped: # Update dependencies from https://github.com/dotnet/arcade build 20191229.1 # # - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19629.1 # The commit message #3 will be skipped: # Update dependencies from https://github.com/dotnet/arcade build 20191230.1 # # - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19630.1 # The commit message #4 will be skipped: # Update dependencies from https://github.com/dotnet/arcade build 20191231.1 # # - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19631.1 # The commit message #5 will be skipped: # Update dependencies from https://github.com/dotnet/arcade build 20200101.1 # # - Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20051.1 # The commit message #6 will be skipped: # Update dependencies from https://github.com/dotnet/arcade build 20191216.5 (dotnet#8079) # # - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19616.5 # The commit message #7 will be skipped: # dispose fsi at the end of a scripting session (dotnet#8084) # # The commit message #8 will be skipped: # Added static link tests and extended CompilerAssert (dotnet#8101) # # * Changed CompilerAssert to static class. Added Compile/Execute methods that take a Compilation description. Added static link tests # # * Hiding compilation description internals # # * Added another test to check for sanity # # * Making a few optional parameters # # * Hiding internals of CompilationReference # The commit message #9 will be skipped: # Parameterize product version (dotnet#8031) # # * Parameterize Product details # # * fcs # # * Repack pkgdef * no ilread
1 parent 8641546 commit baa380b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

LanguageService/Tokenizer.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ module internal Tokenizer =
458458
let lineTokenizer = sourceTokenizer.CreateLineTokenizer(lineContents)
459459
let tokens = ResizeArray<SavedTokenInfo>()
460460
let mutable tokenInfoOption = None
461-
let previousLexState = ref lexState
461+
let mutable previousLexState = lexState
462462

463463
let processToken() =
464464
let classificationType = compilerTokenToRoslynToken(tokenInfoOption.Value.ColorClass)
@@ -471,9 +471,9 @@ module internal Tokenizer =
471471
tokens.Add savedToken
472472

473473
let scanAndColorNextToken() =
474-
let info, nextLexState = lineTokenizer.ScanToken(!previousLexState)
474+
let info, nextLexState = lineTokenizer.ScanToken(previousLexState)
475475
tokenInfoOption <- info
476-
previousLexState := nextLexState
476+
previousLexState <- nextLexState
477477

478478
// Apply some hacks to clean up the token stream (we apply more later)
479479
match info with
@@ -519,7 +519,7 @@ module internal Tokenizer =
519519
classifiedSpans.Add(new ClassifiedSpan(classificationType, textSpan))
520520
startPosition <- endPosition
521521

522-
SourceLineData(textLine.Start, lexState, previousLexState.Value, lineContents.GetHashCode(), classifiedSpans.ToArray(), tokens.ToArray())
522+
SourceLineData(textLine.Start, lexState, previousLexState, lineContents.GetHashCode(), classifiedSpans.ToArray(), tokens.ToArray())
523523

524524

525525
// We keep incremental data per-document. When text changes we correlate text line-by-line (by hash codes of lines)

0 commit comments

Comments
 (0)