mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[syntax-coloring] Remove early exit from delta logic when there are no new highlighted tokens but are removed ones, and take account of the range of the mismatching token in the previous syntax map
We still need to adjust the affected range to the line boundaries and return all tokens on the line when there are no new tokens, as the client will clear all tokens on that line in its copy of the syntax map leaving the other tokens unhighlighted. We also need to extend the affected range to include the ranges of the mismatched tokens from the previous syntaxmap, so their highlighting will be cleared. Also add more comments to better document the new syntax map structure and behaviour.
This commit is contained in:
@@ -133,8 +133,20 @@
|
||||
// After replacing a space with a space
|
||||
|
||||
// CHECK: {{^}}{
|
||||
// CHECK-NEXT: key.diagnostic_stage: source.diagnostic.stage.swift.parse
|
||||
// CHECK-NEXT: key.offset: 57,
|
||||
// CHECK-NEXT: key.length: 15,
|
||||
// CHECK-NEXT: key.diagnostic_stage: source.diagnostic.stage.swift.parse,
|
||||
// CHECK-NEXT: key.syntaxmap: [
|
||||
// CHECK-NEXT: {
|
||||
// CHECK-NEXT: key.kind: source.lang.swift.syntaxtype.keyword,
|
||||
// CHECK-NEXT: key.offset: 57,
|
||||
// CHECK-NEXT: key.length: 6
|
||||
// CHECK-NEXT: },
|
||||
// CHECK-NEXT: {
|
||||
// CHECK-NEXT: key.kind: source.lang.swift.syntaxtype.identifier,
|
||||
// CHECK-NEXT: key.offset: 64,
|
||||
// CHECK-NEXT: key.length: 5
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: ],
|
||||
|
||||
// After adding code at the end of the file
|
||||
|
||||
Reference in New Issue
Block a user