-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/govim: add config option for case sensitive completion (#529)
This is a WIP PR that depends on an as-yet-unmerged CL. Full commit message to follow
- Loading branch information
Showing
7 changed files
with
124 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
cmd/govim/testdata/scenario_casesensitivecompletion/complete.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Test that ominfunc complete works. This simple test uses an existing file on disk that | ||
# already has the relevant import required for the completion. | ||
|
||
vim ex 'e main.go' | ||
errlogmatch -wait 30s 'PublishDiagnostics callback: &protocol.PublishDiagnosticsParams{\n\S+:\s+URI:\s+"file://'$WORK/main.go | ||
|
||
# lower from lo | ||
vim ex 'call cursor(7,1)' | ||
vim normal Slo | ||
vim ex 'execute \"normal A\\<C-X>\\<C-O>\"' | ||
vim ex 'w' | ||
cmp main.go main.go.lowercomplete | ||
# Disabled pending resolution to https://github.com/golang/go/issues/34103 | ||
# errlogmatch -count=0 'LogMessage callback: &protocol\.LogMessageParams\{Type:(1|2), Message:".*' | ||
|
||
# UPPER from UP | ||
vim ex 'call cursor(7,1)' | ||
vim normal SUP | ||
vim ex 'execute \"normal A\\<C-X>\\<C-O>\"' | ||
vim ex 'w' | ||
cmp main.go main.go.uppercomplete | ||
# Disabled pending resolution to https://github.com/golang/go/issues/34103 | ||
# errlogmatch -count=0 'LogMessage callback: &protocol\.LogMessageParams\{Type:(1|2), Message:".*' | ||
|
||
# lower from LO | ||
vim ex 'call cursor(7,1)' | ||
vim normal SLO | ||
vim ex 'execute \"normal A\\<C-X>\\<C-O>\"' | ||
vim ex 'w' | ||
cmp main.go main.go.lowermiss | ||
# Disabled pending resolution to https://github.com/golang/go/issues/34103 | ||
# errlogmatch -count=0 'LogMessage callback: &protocol\.LogMessageParams\{Type:(1|2), Message:".*' | ||
|
||
# UPPER from up | ||
vim ex 'call cursor(7,1)' | ||
vim normal Sup | ||
vim ex 'execute \"normal A\\<C-X>\\<C-O>\"' | ||
vim ex 'w' | ||
cmp main.go main.go.uppermiss | ||
# Disabled pending resolution to https://github.com/golang/go/issues/34103 | ||
# errlogmatch -count=0 'LogMessage callback: &protocol\.LogMessageParams\{Type:(1|2), Message:".*' | ||
|
||
-- go.mod -- | ||
module mod.com | ||
|
||
-- main.go -- | ||
package main | ||
|
||
func main() { | ||
var lower int | ||
var UPPER int | ||
|
||
// | ||
} | ||
-- main.go.lowercomplete -- | ||
package main | ||
|
||
func main() { | ||
var lower int | ||
var UPPER int | ||
|
||
lower | ||
} | ||
-- main.go.uppercomplete -- | ||
package main | ||
|
||
func main() { | ||
var lower int | ||
var UPPER int | ||
|
||
UPPER | ||
} | ||
-- main.go.lowermiss -- | ||
package main | ||
|
||
func main() { | ||
var lower int | ||
var UPPER int | ||
|
||
LO | ||
} | ||
-- main.go.uppermiss -- | ||
package main | ||
|
||
func main() { | ||
var lower int | ||
var UPPER int | ||
|
||
up | ||
} |
6 changes: 6 additions & 0 deletions
6
cmd/govim/testdata/scenario_casesensitivecompletion/default_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"FormatOnSave": "goimports", | ||
"CompletionDeepCompletions": false, | ||
"CompletionFuzzyMatching": false, | ||
"CompletionCaseSensitive": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters