forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only suggest symbols that could be pragmas when typing a pragma (nim-…
…lang#23040) Currently pragmas just fall through to `suggestSentinel` and show everything which isn't very useful. Now it filters for symbols that could be pragmas (templates with `{.pragma.}`, macros, user pragmas) and only shows them
- Loading branch information
1 parent
4fdc6c4
commit 0a70944
Showing
5 changed files
with
85 additions
and
3 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
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,40 @@ | ||
template fooBar1() {.pragma.} | ||
proc fooBar2() = discard | ||
macro fooBar3(x: untyped) = discard | ||
{.pragma: fooBar4 fooBar3.} | ||
|
||
proc test1() {.fooBar#[!]#.} = discard | ||
|
||
var test2 {.fooBar#[!]#.} = 9 | ||
|
||
type | ||
Person {.fooBar#[!]#.} = object | ||
hello {.fooBar#[!]#.}: string | ||
Callback = proc () {.fooBar#[!]#.} | ||
|
||
# Check only macros/templates/pragmas are suggested | ||
discard """ | ||
$nimsuggest --tester $file | ||
>sug $1 | ||
sug;;skTemplate;;fooBar4;;;;$file;;4;;8;;"";;100;;Prefix | ||
sug;;skTemplate;;tsug_pragmas.fooBar1;;template ();;$file;;1;;9;;"";;100;;Prefix | ||
sug;;skMacro;;tsug_pragmas.fooBar3;;macro (x: untyped){.noSideEffect, gcsafe.};;$file;;3;;6;;"";;50;;Prefix | ||
>sug $2 | ||
sug;;skTemplate;;fooBar4;;;;$file;;4;;8;;"";;100;;Prefix | ||
sug;;skTemplate;;tsug_pragmas.fooBar1;;template ();;$file;;1;;9;;"";;100;;Prefix | ||
sug;;skMacro;;tsug_pragmas.fooBar3;;macro (x: untyped){.noSideEffect, gcsafe.};;$file;;3;;6;;"";;50;;Prefix | ||
>sug $3 | ||
sug;;skTemplate;;fooBar4;;;;$file;;4;;8;;"";;100;;Prefix | ||
sug;;skTemplate;;tsug_pragmas.fooBar1;;template ();;$file;;1;;9;;"";;100;;Prefix | ||
sug;;skMacro;;tsug_pragmas.fooBar3;;macro (x: untyped){.noSideEffect, gcsafe.};;$file;;3;;6;;"";;50;;Prefix | ||
>sug $4 | ||
sug;;skTemplate;;fooBar4;;;;$file;;4;;8;;"";;100;;Prefix | ||
sug;;skTemplate;;tsug_pragmas.fooBar1;;template ();;$file;;1;;9;;"";;100;;Prefix | ||
sug;;skMacro;;tsug_pragmas.fooBar3;;macro (x: untyped){.noSideEffect, gcsafe.};;$file;;3;;6;;"";;50;;Prefix | ||
>sug $5 | ||
sug;;skTemplate;;fooBar4;;;;$file;;4;;8;;"";;100;;Prefix | ||
sug;;skTemplate;;tsug_pragmas.fooBar1;;template ();;$file;;1;;9;;"";;100;;Prefix | ||
sug;;skMacro;;tsug_pragmas.fooBar3;;macro (x: untyped){.noSideEffect, gcsafe.};;$file;;3;;6;;"";;50;;Prefix | ||
""" | ||
|
||
|