File tree 5 files changed +12
-1
lines changed 5 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 23
23
* Use 6.0.100 SDK for building (PR: [ omnisharp-roslyn #2269 ] ( https://github.com/OmniSharp/omnisharp-roslyn/pull/2269 ) )
24
24
* Added Code of Conduct (PR: [ omnisharp-roslyn #2266 ] ( https://github.com/OmniSharp/omnisharp-roslyn/pull/2266 ) )
25
25
* Improved Cake/CSX info messages (PR: [ omnisharp-roslyn #2264 ] ( https://github.com/OmniSharp/omnisharp-roslyn/pull/2264 ) )
26
+ * Send document buffer when semantically highlighting old document versions (PR: [ #4915 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4915 ) )
26
27
* Improved Regex syntax highlighting (PR: [ #4902 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4902 ) )
27
28
* .NET 6 bug fixes ([ #4931 ] ( https://github.com/OmniSharp/omnisharp-vscode/issues/4931 ) , PR: [ #4950 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4950 ) )
28
29
* Add File-scoped namespace snippet (PR: [ #4948 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4948 ) )
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ You can also use the .NET 6 build of OmniSharp which runs on the .NET 6 SDK. See
60
60
* Use 6.0.100 SDK for building (PR: [ omnisharp-roslyn #2269 ] ( https://github.com/OmniSharp/omnisharp-roslyn/pull/2269 ) )
61
61
* Added Code of Conduct (PR: [ omnisharp-roslyn #2266 ] ( https://github.com/OmniSharp/omnisharp-roslyn/pull/2266 ) )
62
62
* Improved Cake/CSX info messages (PR: [ omnisharp-roslyn #2264 ] ( https://github.com/OmniSharp/omnisharp-roslyn/pull/2264 ) )
63
+ * Send document buffer when semantically highlighting old document versions (PR: [ #4915 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4915 ) )
63
64
* Improved Regex syntax highlighting (PR: [ #4902 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4902 ) )
64
65
* .NET 6 bug fixes ([ #4931 ] ( https://github.com/OmniSharp/omnisharp-vscode/issues/4931 ) , PR: [ #4950 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4950 ) )
65
66
* Add File-scoped namespace snippet (PR: [ #4948 ] ( https://github.com/OmniSharp/omnisharp-vscode/pull/4948 ) )
Original file line number Diff line number Diff line change 842
842
},
843
843
"csharp.semanticHighlighting.enabled" : {
844
844
"type" : " boolean" ,
845
- "default" : false ,
845
+ "default" : true ,
846
846
"description" : " Enable/disable Semantic Highlighting for C# files (Razor files currently unsupported). Defaults to false. Close open files for changes to take effect." ,
847
847
"scope" : " window"
848
848
},
Original file line number Diff line number Diff line change @@ -198,6 +198,14 @@ export default class SemanticTokensProvider extends AbstractProvider implements
198
198
let req = createRequest < protocol . V2 . SemanticHighlightRequest > ( document , new vscode . Position ( 0 , 0 ) ) ;
199
199
req . Range = range ;
200
200
201
+
202
+ // We need to include the document contents in our request when we are highlighting a version of the document other than the current version, such as in the Diff view.
203
+ const currentDocument = vscode . workspace . textDocuments . find ( d => d . fileName === document . fileName ) ;
204
+ const isCurrentVersion = currentDocument ?. version === document . version ;
205
+ if ( ! isCurrentVersion ) {
206
+ req . VersionedText = document . getText ( ) ;
207
+ }
208
+
201
209
const versionBeforeRequest = document . version ;
202
210
203
211
const response = await serverUtils . getSemanticHighlights ( this . _server , req ) ;
Original file line number Diff line number Diff line change @@ -610,6 +610,7 @@ export namespace V2 {
610
610
611
611
export interface SemanticHighlightRequest extends Request {
612
612
Range ?: Range ;
613
+ VersionedText ?: string ;
613
614
}
614
615
615
616
export interface SemanticHighlightResponse {
You can’t perform that action at this time.
0 commit comments