| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package file |
| 6 |
|
| 7 |
import "golang.org/x/tools/gopls/internal/protocol" |
| 8 |
|
| 9 |
|
| 10 |
type Modification struct { |
| 11 |
URI protocol.DocumentURI |
| 12 |
Action Action |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
OnDisk bool |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
Version int32 |
| 21 |
Text []byte |
| 22 |
|
| 23 |
|
| 24 |
LanguageID protocol.LanguageKind |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
type Action int |
| 29 |
|
| 30 |
const ( |
| 31 |
UnknownAction = Action(iota) |
| 32 |
Open |
| 33 |
Change |
| 34 |
Close |
| 35 |
Save |
| 36 |
Create |
| 37 |
Delete |
| 38 |
) |
| 39 |
|
| 40 |
func (a Action) String() string { |
| 41 |
switch a { |
| 42 |
case Open: |
| 43 |
return "Open" |
| 44 |
case Change: |
| 45 |
return "Change" |
| 46 |
case Close: |
| 47 |
return "Close" |
| 48 |
case Save: |
| 49 |
return "Save" |
| 50 |
case Create: |
| 51 |
return "Create" |
| 52 |
case Delete: |
| 53 |
return "Delete" |
| 54 |
default: |
| 55 |
return "Unknown" |
| 56 |
} |
| 57 |
} |