-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issues covered: - vala-language-server#57 - vala-language-server#106 - vala-language-server#138 - vala-language-server#153 Unit tests: - diagnostics
- Loading branch information
Showing
11 changed files
with
190 additions
and
209 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
build/ | ||
*.o | ||
subprojects/lstf |
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 |
---|---|---|
|
@@ -80,5 +80,5 @@ subdir('data') | |
subdir('src') | ||
|
||
if get_option('tests') | ||
subdir('test') | ||
subdir('tests') | ||
endif |
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 @@ | ||
[wrap-git] | ||
url = https://github.com/Prince781/lstf | ||
revision = head | ||
|
||
[provide] | ||
program_names = lstf |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
// issue: vala-language-server#106 | ||
server_path = option('server-path'); | ||
|
||
let f = file(` | ||
void main() { | ||
print ("this is a string"); | ||
} | ||
`); | ||
|
||
project_files = [ f ]; | ||
|
||
|
||
|
||
await change(f, { | ||
range: { | ||
start: { line: 2, character: 29 }, | ||
end: { line: 2, character: 29 } | ||
}, | ||
text: '.' | ||
}); | ||
|
||
assert { | ||
isIncomplete: false, | ||
items: [] | ||
} <=> await completion(f, 2, 29); |
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,35 @@ | ||
// issue: vala-language-server#138 | ||
server_path = options('server-path'); | ||
|
||
let f = file(` | ||
interface Iface { | ||
public abstract void must_override(); | ||
} | ||
class Sas : Iface, Object { | ||
|
||
} | ||
`); | ||
|
||
project_files = [ f ]; | ||
|
||
|
||
|
||
await change(f, { | ||
range: { | ||
start: { line: 7, character: 5 }, | ||
end: { line: 7, character: 5 } | ||
}, | ||
text: '\n p' | ||
}); | ||
|
||
assert { | ||
isIncomplete: false, | ||
completions: [ | ||
{ | ||
label: 'public void must_override()', | ||
kind: CompletionItemKind.Method, | ||
insertText: 'public void must_override()$0', | ||
insertTextFormat: InsertTextFormat.Snippet | ||
} | ||
] | ||
} <=> await completion(f, 8, 6); |
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,32 @@ | ||
// issue: vala-language-server#153 | ||
server_path = option('server-path'); | ||
|
||
let f = file(` | ||
void foo (int arg1, int arg2) { | ||
} | ||
void main() { | ||
foo | ||
} | ||
`); | ||
|
||
project_files = [ f ]; | ||
|
||
|
||
|
||
await change(f, { | ||
range: { | ||
start: { line: 4, character: 7 }, | ||
end: { line: 4, character: 7 } | ||
}, | ||
text: ' (' | ||
}); | ||
|
||
assert { | ||
signatures: [ | ||
{ | ||
label: 'void foo(int arg1, int arg2)', | ||
parameters: [ { label: 'int arg1' } ] | ||
} | ||
], | ||
activeParameter: 0 | ||
} <=> await signatureHelp(f, 4, 9); |
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,49 @@ | ||
// issue: vala-language-server#57 | ||
server_path = option('server-path'); | ||
|
||
let f = file(` | ||
interface Iface { | ||
public abstract void must_override1(); | ||
public abstract void must_override2(int arg1); | ||
public abstract void must_override3(int arg1, bool arg2); | ||
} | ||
class Sas : Iface, Object { | ||
|
||
} | ||
`); | ||
|
||
project_files = [ f ]; | ||
|
||
|
||
|
||
await change(f, { | ||
range: { | ||
start: { line: 7, character: 5 }, | ||
end: { line: 7, character: 5 } | ||
}, | ||
text: 'p' | ||
}); | ||
|
||
assert { | ||
isIncomplete: false, | ||
completions: [ | ||
{ | ||
label: 'public void must_override1()', | ||
kind: CompletionItemKind.Method, | ||
insertText: 'public void must_override1()$0', | ||
insertTextFormat: InsertTextFormat.Snippet, | ||
}, | ||
{ | ||
label: 'public void must_override2(int arg1)', | ||
kind: CompletionItemKind.Method, | ||
insertText: 'public void must_override2(int ${1:arg1})$0', | ||
insertTextFormat: InsertTextFormat.Snippet, | ||
}, | ||
{ | ||
label: 'public void must_override3(int arg1, bool arg2)', | ||
kind: CompletionItemKind.Method, | ||
insertText: 'public void must_override3(int ${1:arg1}, bool ${2:arg2})$0', | ||
insertTextFormat: InsertTextFormat.Snippet | ||
} | ||
] | ||
} <=> await completion(f, 7, 5); |
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,17 @@ | ||
server_path = option('server-path'); | ||
let f = file(`void main(string args[]) {}`); | ||
project_files = [ f ]; | ||
|
||
assert { | ||
diagnostics: [ | ||
..., | ||
{ | ||
range: { | ||
start: { line: 3, character: 5 }, | ||
end: { line: 3, character: 16 } | ||
}, | ||
severity: DiagnosticSeverity.Error | ||
}, | ||
... | ||
] | ||
} <=> await diagnostics(f); |
Oops, something went wrong.