File: change_quote.txt

package info (click to toggle)
golang-golang-x-tools 1%3A0.25.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,724 kB
  • sloc: javascript: 2,027; asm: 1,645; sh: 166; yacc: 155; makefile: 49; ansic: 8
file content (69 lines) | stat: -rw-r--r-- 3,279 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
This test checks the behavior of the 'change quote' code action.

-- flags --
-ignore_extra_diags

-- go.mod --
module golang.org/lsptests/changequote

go 1.18

-- a.go --
package changequote

import (
	"fmt"
)

func foo() {
	var s string
	s = "hello" //@codeactionedit(`"`, "refactor.rewrite", a1, "Convert to raw string literal")
	s = `hello` //@codeactionedit("`", "refactor.rewrite", a2, "Convert to interpreted string literal")
	s = "hello\tworld" //@codeactionedit(`"`, "refactor.rewrite", a3, "Convert to raw string literal")
	s = `hello	world` //@codeactionedit("`", "refactor.rewrite", a4, "Convert to interpreted string literal")
	s = "hello\nworld" //@codeactionedit(`"`, "refactor.rewrite", a5, "Convert to raw string literal")
	// add a comment  to avoid affect diff compute
	s = `hello
world` //@codeactionedit("`", "refactor.rewrite", a6, "Convert to interpreted string literal")
	s = "hello\"world" //@codeactionedit(`"`, "refactor.rewrite", a7, "Convert to raw string literal")
	s = `hello"world` //@codeactionedit("`", "refactor.rewrite", a8, "Convert to interpreted string literal")
	s = "hello\x1bworld" //@codeactionerr(`"`, "", "refactor.rewrite", re"found 0 CodeActions")
	s = "hello`world" //@codeactionerr(`"`, "", "refactor.rewrite", re"found 0 CodeActions")
	s = "hello\x7fworld" //@codeactionerr(`"`, "", "refactor.rewrite", re"found 0 CodeActions")
	fmt.Println(s)
}

-- @a1/a.go --
@@ -9 +9 @@
-	s = "hello" //@codeactionedit(`"`, "refactor.rewrite", a1, "Convert to raw string literal")
+	s = `hello` //@codeactionedit(`"`, "refactor.rewrite", a1, "Convert to raw string literal")
-- @a2/a.go --
@@ -10 +10 @@
-	s = `hello` //@codeactionedit("`", "refactor.rewrite", a2, "Convert to interpreted string literal")
+	s = "hello" //@codeactionedit("`", "refactor.rewrite", a2, "Convert to interpreted string literal")
-- @a3/a.go --
@@ -11 +11 @@
-	s = "hello\tworld" //@codeactionedit(`"`, "refactor.rewrite", a3, "Convert to raw string literal")
+	s = `hello	world` //@codeactionedit(`"`, "refactor.rewrite", a3, "Convert to raw string literal")
-- @a4/a.go --
@@ -12 +12 @@
-	s = `hello	world` //@codeactionedit("`", "refactor.rewrite", a4, "Convert to interpreted string literal")
+	s = "hello\tworld" //@codeactionedit("`", "refactor.rewrite", a4, "Convert to interpreted string literal")
-- @a5/a.go --
@@ -13 +13,2 @@
-	s = "hello\nworld" //@codeactionedit(`"`, "refactor.rewrite", a5, "Convert to raw string literal")
+	s = `hello
+world` //@codeactionedit(`"`, "refactor.rewrite", a5, "Convert to raw string literal")
-- @a6/a.go --
@@ -15,2 +15 @@
-	s = `hello
-world` //@codeactionedit("`", "refactor.rewrite", a6, "Convert to interpreted string literal")
+	s = "hello\nworld" //@codeactionedit("`", "refactor.rewrite", a6, "Convert to interpreted string literal")
-- @a7/a.go --
@@ -17 +17 @@
-	s = "hello\"world" //@codeactionedit(`"`, "refactor.rewrite", a7, "Convert to raw string literal")
+	s = `hello"world` //@codeactionedit(`"`, "refactor.rewrite", a7, "Convert to raw string literal")
-- @a8/a.go --
@@ -18 +18 @@
-	s = `hello"world` //@codeactionedit("`", "refactor.rewrite", a8, "Convert to interpreted string literal")
+	s = "hello\"world" //@codeactionedit("`", "refactor.rewrite", a8, "Convert to interpreted string literal")