golang.org/x/tools/gopls@v0.15.3/internal/test/marker/testdata/hover/basiclit.txt (about) 1 This test checks gopls behavior when hovering over basic literals. 2 3 Requires go1.19+ for the new go/doc/comment package. 4 5 -- flags -- 6 -min_go=go1.19 7 8 -- basiclit.go -- 9 package basiclit 10 11 func _() { 12 _ = 'a' //@hover("'a'", "'a'", latinA) 13 _ = 0x61 //@hover("0x61", "0x61", latinAHex) 14 15 _ = '\u2211' //@hover("'\\u2211'", "'\\u2211'", summation) 16 _ = 0x2211 //@hover("0x2211", "0x2211", summationHex) 17 _ = "foo \u2211 bar" //@hover("\\u2211", "\\u2211", summation) 18 19 _ = '\a' //@hover("'\\a'", "'\\a'", control) 20 _ = "foo \a bar" //@hover("\\a", "\\a", control) 21 22 _ = '\U0001F30A' //@hover("'\\U0001F30A'", "'\\U0001F30A'", waterWave) 23 _ = 0x0001F30A //@hover("0x0001F30A", "0x0001F30A", waterWaveHex) 24 _ = 0X0001F30A //@hover("0X0001F30A", "0X0001F30A", waterWaveHex) 25 _ = "foo \U0001F30A bar" //@hover("\\U0001F30A", "\\U0001F30A", waterWave) 26 27 _ = '\x7E' //@hover("'\\x7E'", "'\\x7E'", tilde) 28 _ = "foo \x7E bar" //@hover("\\x7E", "\\x7E", tilde) 29 _ = "foo \a bar" //@hover("\\a", "\\a", control) 30 31 _ = '\173' //@hover("'\\173'", "'\\173'", leftCurly) 32 _ = "foo \173 bar" //@hover("\\173","\\173", leftCurly) 33 _ = "foo \173 bar \u2211 baz" //@hover("\\173","\\173", leftCurly) 34 _ = "foo \173 bar \u2211 baz" //@hover("\\u2211","\\u2211", summation) 35 _ = "foo\173bar\u2211baz" //@hover("\\173","\\173", leftCurly) 36 _ = "foo\173bar\u2211baz" //@hover("\\u2211","\\u2211", summation) 37 38 // search for runes in string only if there is an escaped sequence 39 _ = "hello" //@hover(`"hello"`, _, _) 40 41 // incorrect escaped rune sequences 42 _ = '\0' //@hover("'\\0'", _, _),diag(re`\\0()'`, re"illegal character") 43 _ = '\u22111' //@hover("'\\u22111'", _, _) 44 _ = '\U00110000' //@hover("'\\U00110000'", _, _) 45 _ = '\u12e45'//@hover("'\\u12e45'", _, _) 46 _ = '\xa' //@hover("'\\xa'", _, _) 47 _ = 'aa' //@hover("'aa'", _, _) 48 49 // other basic lits 50 _ = 1 //@hover("1", _, _) 51 _ = 1.2 //@hover("1.2", _, _) 52 _ = 1.2i //@hover("1.2i", _, _) 53 _ = 0123 //@hover("0123", _, _) 54 _ = 0b1001 //@hover("0b", "0b1001", binaryNumber) 55 _ = 0B1001 //@hover("0B", "0B1001", binaryNumber) 56 _ = 0o77 //@hover("0o", "0o77", octalNumber) 57 _ = 0O77 //@hover("0O", "0O77", octalNumber) 58 _ = 0x1234567890 //@hover("0x1234567890", "0x1234567890", hexNumber) 59 _ = 0X1234567890 //@hover("0X1234567890", "0X1234567890", hexNumber) 60 _ = 0x1000000000000000000 //@hover("0x1", "0x1000000000000000000", bigHex) 61 ) 62 -- @bigHex -- 63 4722366482869645213696 64 -- @binaryNumber -- 65 9 66 -- @control -- 67 U+0007, control 68 -- @hexNumber -- 69 78187493520 70 -- @latinA -- 71 'a', U+0061, LATIN SMALL LETTER A 72 -- @latinAHex -- 73 97, 'a', U+0061, LATIN SMALL LETTER A 74 -- @leftCurly -- 75 '{', U+007B, LEFT CURLY BRACKET 76 -- @octalNumber -- 77 63 78 -- @summation -- 79 '∑', U+2211, N-ARY SUMMATION 80 -- @summationHex -- 81 8721, '∑', U+2211, N-ARY SUMMATION 82 -- @tilde -- 83 '~', U+007E, TILDE 84 -- @waterWave -- 85 '🌊', U+1F30A, WATER WAVE 86 -- @waterWaveHex -- 87 127754, '🌊', U+1F30A, WATER WAVE