Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate UI code and business logic for the resolve and verify commands #4798

Merged
merged 239 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 235 commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
fa63567
Compilation events draft
keyboardDrummer Oct 30, 2023
cb443d8
Gutter icons using IdeState draft
keyboardDrummer Oct 30, 2023
ae2416f
Remove unused field
keyboardDrummer Oct 30, 2023
5168c3f
Merge branch 'ideStateBasedGutterIcons' into compilationEvents
keyboardDrummer Oct 30, 2023
83b6344
ObservableErrorReporter
keyboardDrummer Oct 30, 2023
09bb2d0
Builds. ActionInput relying on tokens is still an issue though
keyboardDrummer Oct 30, 2023
95099a3
Diagnostics work again
keyboardDrummer Oct 30, 2023
6768460
Cleanup
keyboardDrummer Oct 30, 2023
ce3d06f
Various fixes
keyboardDrummer Oct 31, 2023
8a32cc6
Fix
keyboardDrummer Oct 31, 2023
39b4aba
Fixes
keyboardDrummer Oct 31, 2023
a2094b9
Remove comment
keyboardDrummer Nov 1, 2023
c9e889e
Update verification trees through events, instead of through Compilat…
keyboardDrummer Nov 1, 2023
ffee6cf
Many diagnostics tests pass
keyboardDrummer Nov 1, 2023
2427f1e
Most tests pass, except the tree ones
keyboardDrummer Nov 1, 2023
e77b252
More fixes
keyboardDrummer Nov 1, 2023
131aa13
Signature help handler tests pass
keyboardDrummer Nov 1, 2023
61a5d68
Bunch of gutter icon tests now passing
keyboardDrummer Nov 1, 2023
37982ae
Gutter status seems to work as well
keyboardDrummer Nov 1, 2023
9ac85b9
Ran formatter
keyboardDrummer Nov 1, 2023
dbd44fe
Merge branch 'master' into compilationEvents
keyboardDrummer Nov 1, 2023
6f6fbd6
Compilation changes
keyboardDrummer Nov 1, 2023
93e065c
Diagnostics cleanup
keyboardDrummer Nov 1, 2023
c2abf78
Merge branch 'master' into compilationEvents
keyboardDrummer Nov 2, 2023
88ec526
Little bit more compilation cleanup
keyboardDrummer Nov 2, 2023
26e70f8
Merge branch 'compilationEvents' of github.com:keyboardDrummer/dafny …
keyboardDrummer Nov 2, 2023
8acea63
Last document changes
keyboardDrummer Nov 2, 2023
9d4c213
It compiles
keyboardDrummer Nov 2, 2023
16b1db9
Cleanup
keyboardDrummer Nov 2, 2023
86993be
Renames
keyboardDrummer Nov 2, 2023
9e3f1c4
Fixes
keyboardDrummer Nov 2, 2023
026bc73
Fix tests
keyboardDrummer Nov 2, 2023
f8a0d64
Actions are now working
keyboardDrummer Nov 2, 2023
d2992c8
Tweaks
keyboardDrummer Nov 2, 2023
81f1c3a
Moved some members
keyboardDrummer Nov 2, 2023
6bc32f9
More fixes
keyboardDrummer Nov 2, 2023
cbe3d22
All tests except OpenAndCloseConcurrentlySameProject pass
keyboardDrummer Nov 2, 2023
ecca0bf
Fixes
keyboardDrummer Nov 2, 2023
3514eb9
Merge branch 'master' into compilationEvents
keyboardDrummer Nov 2, 2023
67189e2
Cleanuppppp
keyboardDrummer Nov 2, 2023
c8a8530
Fixes
keyboardDrummer Nov 3, 2023
57df256
More fixes
keyboardDrummer Nov 3, 2023
f583241
Merge branch 'compilationEvents' of github.com:keyboardDrummer/dafny …
keyboardDrummer Nov 3, 2023
920acbc
Merge branch 'master' into compilationEvents
keyboardDrummer Nov 3, 2023
3baa67a
Fix concurrency issue
keyboardDrummer Nov 3, 2023
6e85348
Refactoring
keyboardDrummer Nov 3, 2023
191c460
Merge branch 'compilationEvents' of github.com:keyboardDrummer/dafny …
keyboardDrummer Nov 3, 2023
6d02ac4
Fixes
keyboardDrummer Nov 3, 2023
2d2ee5d
Fixes
keyboardDrummer Nov 3, 2023
92174e4
Change error handling so it works reliable
keyboardDrummer Nov 3, 2023
e4f5035
Formatting
keyboardDrummer Nov 3, 2023
9bd1424
Fix incorrect implementation status combination
keyboardDrummer Nov 3, 2023
d977720
Fix Combine PublishedVerificationStatus
keyboardDrummer Nov 3, 2023
f567d89
Add extra test
keyboardDrummer Nov 3, 2023
093fdd1
Merge branch 'master' into compilationEvents
keyboardDrummer Nov 3, 2023
cf49995
Revert formatting changes
keyboardDrummer Nov 3, 2023
5658eb3
Merge remote-tracking branch 'origin/master' into compilationEvents
keyboardDrummer Nov 3, 2023
9632cd3
Merge branch 'compilationEvents' of github.com:keyboardDrummer/dafny …
keyboardDrummer Nov 3, 2023
84d0ef9
Merge branch 'master' into compilationEvents
keyboardDrummer Nov 6, 2023
1cf25a6
Make tests more stable
keyboardDrummer Nov 6, 2023
ce52c3c
Add missing newline
keyboardDrummer Nov 6, 2023
2ee9812
Merge branch 'compilationEvents' of github.com:keyboardDrummer/dafny …
keyboardDrummer Nov 6, 2023
eaf2412
Add tracing to debug concurrency issues
keyboardDrummer Nov 6, 2023
8afdb8b
Add more logging
keyboardDrummer Nov 7, 2023
9c2915f
Small refactoring
keyboardDrummer Nov 8, 2023
b8c881a
Renames
keyboardDrummer Nov 9, 2023
550f19f
Merge remote-tracking branch 'origin/master' into compilationEvents
keyboardDrummer Nov 9, 2023
ee46d80
Ran formatter
keyboardDrummer Nov 9, 2023
ebd672c
Improve CI logging
keyboardDrummer Nov 10, 2023
fff38b5
More logging
keyboardDrummer Nov 10, 2023
22099a7
Trace logging for counter examples
keyboardDrummer Nov 10, 2023
2972108
More logging
keyboardDrummer Nov 10, 2023
4670cd2
It compiles
keyboardDrummer Nov 10, 2023
ad2aff3
Resolve some null issues
keyboardDrummer Nov 10, 2023
b9f3e27
Ran formatter
keyboardDrummer Nov 10, 2023
187a956
Resolve some warnings
keyboardDrummer Nov 10, 2023
592bde2
Use DafnyFile instead of Uri for CompilationInput
keyboardDrummer Nov 10, 2023
68c9e07
Enable standard library in dafny server
keyboardDrummer Nov 10, 2023
61f1345
Fixes
keyboardDrummer Nov 10, 2023
b30f041
Remove getContentOverride
keyboardDrummer Nov 10, 2023
540501d
Merge branch 'master' into standardLibServer
keyboardDrummer Nov 10, 2023
0b70c96
Fixes
keyboardDrummer Nov 11, 2023
7e3cdf7
Merge branch 'standardLibServer' of github.com:keyboardDrummer/dafny …
keyboardDrummer Nov 11, 2023
31944b3
Fix comp error
keyboardDrummer Nov 11, 2023
afc7f8b
Add missing extension
keyboardDrummer Nov 11, 2023
4fdc7fb
Merge branch 'standardLibServer' into mergedCLiAndServer
keyboardDrummer Nov 11, 2023
d20a7b7
Move RunCompiler
keyboardDrummer Nov 11, 2023
f8820b5
Support libraries
keyboardDrummer Nov 14, 2023
b5b757a
Merge remote-tracking branch 'origin/master' into standardLibServer
keyboardDrummer Nov 14, 2023
6c8567f
Ran formatter
keyboardDrummer Nov 14, 2023
c1ed48d
Resolve warning
keyboardDrummer Nov 14, 2023
1f4f4b6
Improve error handling of validating Dafny files
keyboardDrummer Nov 15, 2023
3975f74
Remove IllegalDafnyFile class
keyboardDrummer Nov 15, 2023
e1f7ad3
Test fix
keyboardDrummer Nov 15, 2023
fc4a2cb
Store state
keyboardDrummer Nov 15, 2023
3d7f0e2
Remove lazyness from latestIdeState
keyboardDrummer Nov 15, 2023
cd38120
Add new test
keyboardDrummer Nov 15, 2023
c37bbe0
Fix test
keyboardDrummer Nov 15, 2023
75d0071
Merge remote-tracking branch 'origin/master' into standardLibServer
keyboardDrummer Nov 15, 2023
932461b
Server tests pass
keyboardDrummer Nov 15, 2023
046759c
Renames
keyboardDrummer Nov 15, 2023
cc95549
Add test for using library=[..] in dfyconfig.toml, together with dafn…
keyboardDrummer Nov 15, 2023
7a405bd
Merge remote-tracking branch 'origin/master' into standardLibServer
keyboardDrummer Nov 17, 2023
d2cf87a
Refactor
keyboardDrummer Nov 17, 2023
291b3ff
Fix tests and improve error handling consistency
keyboardDrummer Nov 17, 2023
1e38a42
Windows fix
keyboardDrummer Nov 17, 2023
a842f6d
Merge branch 'standardLibServer' into mergedCLiAndServer
keyboardDrummer Nov 17, 2023
5846bde
Ran formatter
keyboardDrummer Nov 17, 2023
6ada44f
Moved class into separate file
keyboardDrummer Nov 17, 2023
77e7f6c
Merge commit 'dd7a142bba66d' into mergedCLiAndServer
keyboardDrummer Nov 17, 2023
8d28463
Fix
keyboardDrummer Nov 20, 2023
5a64fe5
Draft changes for starting the actual merge
keyboardDrummer Nov 20, 2023
a58209a
Split DafnyCli into a new and an old class, and move GetBackend to Co…
keyboardDrummer Nov 28, 2023
57cd2d6
UsesLibrary test passes
keyboardDrummer Nov 29, 2023
ea68155
ast.dfy fails at the verification summary comparison
keyboardDrummer Nov 29, 2023
a5e1877
autoRevealDependencies/ast.dfy now passes using DafnyNewCli
keyboardDrummer Dec 1, 2023
19921ed
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Dec 1, 2023
fcfd469
Add nullable enabled pragma
keyboardDrummer Dec 1, 2023
6cdee73
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Dec 4, 2023
454dd46
Fixes
keyboardDrummer Dec 4, 2023
364b6d7
Fix incorrect Uri bug
keyboardDrummer Dec 5, 2023
2871fd9
Verification diagnostics shown in correct order and with correct posi…
keyboardDrummer Dec 5, 2023
d4bc32d
Small refactoring
keyboardDrummer Dec 5, 2023
eb8430d
ComputationsLoop passes
keyboardDrummer Dec 6, 2023
31b2510
Fixes
keyboardDrummer Dec 7, 2023
3413316
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Dec 7, 2023
b8ed900
Update customBoogie.patch
keyboardDrummer Dec 7, 2023
7822e30
Change error handling
keyboardDrummer Dec 7, 2023
22233f1
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Dec 19, 2023
518ca90
Merge branch 'master' into mergedCLiAndServer
keyboardDrummer Dec 19, 2023
eb27708
Fix reporting bugs
keyboardDrummer Dec 19, 2023
ca34a2f
Fix bugs
keyboardDrummer Dec 20, 2023
0a870ec
Fixes
keyboardDrummer Dec 20, 2023
13a7118
Merge branch 'master' into mergedCLiAndServer
keyboardDrummer Dec 20, 2023
a2b91c6
Fix language server bugs
keyboardDrummer Dec 20, 2023
5c224f9
Refactoring and fix
keyboardDrummer Dec 20, 2023
7b15bff
Refactoring
keyboardDrummer Dec 20, 2023
0e72ec5
Fix bug and rename
keyboardDrummer Dec 20, 2023
bd183df
Rename
keyboardDrummer Dec 20, 2023
b7aa218
Sort counterexamples
keyboardDrummer Dec 20, 2023
855b41b
Merge branch 'mergedCLiAndServer' of github.com:keyboardDrummer/dafny…
keyboardDrummer Dec 20, 2023
69724bb
Merge branch 'master' into mergedCLiAndServer
keyboardDrummer Dec 20, 2023
36b59fa
Move non-commands out of commands folder
keyboardDrummer Dec 20, 2023
7f1a470
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Dec 20, 2023
74ec155
Merge branch 'mergedCLiAndServer' of github.com:keyboardDrummer/dafny…
keyboardDrummer Dec 20, 2023
2c6e76a
Fixes
keyboardDrummer Dec 21, 2023
d6a07c4
Fix JSON diagnostics
keyboardDrummer Dec 21, 2023
c813d5a
Fix replaceableResolve1Errors.dfy
keyboardDrummer Dec 21, 2023
177ff45
Ran formatter
keyboardDrummer Dec 22, 2023
c803c05
Delete unused file
keyboardDrummer Dec 22, 2023
12c9b9a
Split responsibilities around CLI into different classes
keyboardDrummer Dec 22, 2023
3bfad62
Move some classes into their own file
keyboardDrummer Dec 22, 2023
5ad85ec
Delete folder
keyboardDrummer Dec 22, 2023
116a0dd
Undo rename
keyboardDrummer Dec 22, 2023
f4514de
Merge remote-tracking branch 'fork/cliCodeRefactoring' into mergedCLi…
keyboardDrummer Dec 22, 2023
cf58b44
Reporting fix
keyboardDrummer Dec 22, 2023
d155159
cli_bad_option passes
keyboardDrummer Jan 2, 2024
dd17a44
Various fixes
keyboardDrummer Jan 2, 2024
5d371fa
Improve error checking related code
keyboardDrummer Jan 2, 2024
5a99089
Merge commit 'd3c05bb01' into mergedCLiAndServer
keyboardDrummer Jan 2, 2024
35f954c
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 2, 2024
f1c7137
Fix bad merge
keyboardDrummer Jan 2, 2024
9eb017d
Fix big bug
keyboardDrummer Jan 2, 2024
564319f
Update pre-resolution related error output
keyboardDrummer Jan 2, 2024
32f4a13
Doc test improvements
keyboardDrummer Jan 2, 2024
a8ff93d
Fix unit tests
keyboardDrummer Jan 2, 2024
a8ee077
Fix various bugs
keyboardDrummer Jan 3, 2024
dad1af1
Fixes
keyboardDrummer Jan 3, 2024
08a702e
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 3, 2024
738a18d
Undo move to make diff slightly easier
keyboardDrummer Jan 3, 2024
ee045e4
Refactor reporting code
keyboardDrummer Jan 3, 2024
a2f2480
Undo bad merge
keyboardDrummer Jan 3, 2024
419e9be
Fix comp error
keyboardDrummer Jan 3, 2024
0c15f7f
Stop counting splits
keyboardDrummer Jan 3, 2024
b045222
Fix result counting bug
keyboardDrummer Jan 3, 2024
77b85b2
Update expect file
keyboardDrummer Jan 3, 2024
365f89b
Add integration test job timeout
keyboardDrummer Jan 3, 2024
2933671
Update expect file
keyboardDrummer Jan 3, 2024
4d3e527
Fix expect files
keyboardDrummer Jan 3, 2024
5579642
Merge branch 'reportingRefactoring' into mergedCLiAndServer
keyboardDrummer Jan 3, 2024
43cd6ce
Pragma warning
keyboardDrummer Jan 3, 2024
a3bfc2e
Fixes
keyboardDrummer Jan 3, 2024
305d5ee
Update namespaces
keyboardDrummer Jan 3, 2024
e6869cb
Fix comp error
keyboardDrummer Jan 3, 2024
8a93732
Fix various issues and the expect file
keyboardDrummer Jan 4, 2024
988e06b
Fixes and expect file updates
keyboardDrummer Jan 4, 2024
c657d28
Performance fix, so the DafnyConsolePrinter cache is used
keyboardDrummer Jan 4, 2024
e2a5ac3
Revert "Performance fix, so the DafnyConsolePrinter cache is used"
keyboardDrummer Jan 4, 2024
0d49137
Performance fix for writing source code snippets
keyboardDrummer Jan 4, 2024
4846595
Predicates.dfy now passes
keyboardDrummer Jan 4, 2024
0974214
Update expect files
keyboardDrummer Jan 4, 2024
39a6f15
Update expect files
keyboardDrummer Jan 4, 2024
367ac15
Fix big bug
keyboardDrummer Jan 4, 2024
0763497
Merge branch 'master' into mergedCLiAndServer
keyboardDrummer Jan 4, 2024
0927c30
Various fixes and expect file updates
keyboardDrummer Jan 5, 2024
9a63248
Fix custom error message
keyboardDrummer Jan 5, 2024
1482a5b
Fix docs expectation
keyboardDrummer Jan 5, 2024
b1ab81f
Merge branch 'mergedCLiAndServer' of github.com:keyboardDrummer/dafny…
keyboardDrummer Jan 5, 2024
e906bf4
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 5, 2024
09f3db3
Extract classes into separate files
keyboardDrummer Jan 5, 2024
86513c4
Extract Util into a separate file and rename to DiagnosticUtil
keyboardDrummer Jan 5, 2024
5454c3b
Merge branch 'reportingRefactoring' into mergedCLiAndServer
keyboardDrummer Jan 5, 2024
1b11871
Bring back old related message behavior and update expect files
keyboardDrummer Jan 5, 2024
2750afa
Bring back old related message behavior and update expect files
keyboardDrummer Jan 5, 2024
4351fea
Update Xunit test assertions
keyboardDrummer Jan 5, 2024
247baa0
Merge remote-tracking branch 'origin/master' into reportingRefactoring
keyboardDrummer Jan 5, 2024
cc4002a
Update expect file
keyboardDrummer Jan 5, 2024
1094939
Merge branch 'reportingRefactoring' into mergedCLiAndServer
keyboardDrummer Jan 5, 2024
8c5d5c6
Ran formatter
keyboardDrummer Jan 5, 2024
c46a475
Fix warning
keyboardDrummer Jan 9, 2024
7c42386
Merge branch 'reportingRefactoring' into mergedCLiAndServer
keyboardDrummer Jan 10, 2024
79996b0
Merge commit '7d14cadb8b68a~1' into mergedCLiAndServer
keyboardDrummer Jan 10, 2024
0ad3441
Merge commit '7d14cadb8b68a' into mergedCLiAndServer
keyboardDrummer Jan 10, 2024
b988288
Fix order of proof coverage diagnostics
keyboardDrummer Jan 10, 2024
89b1aae
Various fixes
keyboardDrummer Jan 10, 2024
664bdbe
Remove DafnySymbolKind
keyboardDrummer Jan 10, 2024
424f8ca
Simplify snippet code
keyboardDrummer Jan 10, 2024
dbc31c6
Code review
keyboardDrummer Jan 10, 2024
4e663af
Fix expect file
keyboardDrummer Jan 10, 2024
0d45ab9
Code review updates
keyboardDrummer Jan 16, 2024
f0fdc8a
Fix problem
keyboardDrummer Jan 17, 2024
3eac744
Merge remote-tracking branch 'origin' into mergedCLiAndServer
keyboardDrummer Jan 17, 2024
87a1c87
Ran formatter
keyboardDrummer Jan 17, 2024
ee0c25b
Fix expect files
keyboardDrummer Jan 17, 2024
a6f8abe
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 17, 2024
51d0d82
Fixes related to exceptions
keyboardDrummer Jan 17, 2024
7ed5fb7
Add tests and fixes
keyboardDrummer Jan 18, 2024
4bce2b2
Ran formatter
keyboardDrummer Jan 18, 2024
cd53845
Cleanup
keyboardDrummer Jan 18, 2024
dac2895
Update Source/DafnyCore/Pipeline/Compilation.cs
keyboardDrummer Jan 19, 2024
7da110c
Small updates
keyboardDrummer Jan 19, 2024
91b259e
Merge branch 'mergedCLiAndServer' of github.com:keyboardDrummer/dafny…
keyboardDrummer Jan 19, 2024
f68f103
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 20, 2024
6ce9aeb
Fix expect files
keyboardDrummer Jan 22, 2024
c5cdef6
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 22, 2024
2961bb2
Code review
keyboardDrummer Jan 23, 2024
59d0b39
Merge remote-tracking branch 'origin/master' into mergedCLiAndServer
keyboardDrummer Jan 23, 2024
1ef5366
Fix oops
keyboardDrummer Jan 23, 2024
fad0e12
Fix IDE bug
keyboardDrummer Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/integration-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
shard-list: ${{ steps.populate-shard-list.outputs.shard-list }}
test:
needs: populate-matrix-dimensions
timeout-minutes: 120
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
5 changes: 2 additions & 3 deletions Source/DafnyCore/AST/Cloner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,8 @@ public virtual Type CloneType(Type t) {
} else if (t is MultiSetType) {
var tt = (MultiSetType)t;
return new MultiSetType(tt.HasTypeArg() ? CloneType(tt.Arg) : null);
} else if (t is MapType) {
var tt = (MapType)t;
return new MapType(tt.Finite, CloneType(tt.Domain), CloneType(tt.Range));
} else if (t is MapType mapType) {
return new MapType(this, mapType);
} else if (t is ArrowType) {
var tt = (ArrowType)t;
return new ArrowType(Tok(tt.tok), tt.Args.ConvertAll(CloneType), CloneType(tt.Result));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics.Contracts;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -86,7 +87,7 @@ public string AssignUniqueName(FreshIdGenerator generator) {
}

public abstract IToken NameToken { get; }
public DafnySymbolKind Kind => throw new NotImplementedException();
public SymbolKind Kind => throw new NotImplementedException();
public string GetDescription(DafnyOptions options) {
throw new NotImplementedException();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -134,7 +135,7 @@ public NonglobalVariable(IToken tok, string name, Type type, bool isGhost) {
public IToken NameToken => tok;
public override IEnumerable<INode> Children => IsTypeExplicit ? new List<Node> { Type } : Enumerable.Empty<Node>();
public override IEnumerable<INode> PreResolveChildren => IsTypeExplicit ? new List<Node>() { Type } : Enumerable.Empty<Node>();
public DafnySymbolKind Kind => DafnySymbolKind.Variable;
public SymbolKind Kind => SymbolKind.Variable;
public string GetDescription(DafnyOptions options) {
return this.AsText();
}
Expand Down
2 changes: 2 additions & 0 deletions Source/DafnyCore/AST/Grammar/Printer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ public static string ToStringWithoutNewline(System.IO.StringWriter wr) {
}

public void PrintProgramLargeStack(Program prog, bool afterResolver) {
#pragma warning disable VSTHRD002
keyboardDrummer marked this conversation as resolved.
Show resolved Hide resolved
DafnyMain.LargeStackFactory.StartNew(() => PrintProgram(prog, afterResolver)).Wait();
#pragma warning restore VSTHRD002
}

public void PrintProgram(Program prog, bool afterResolver) {
Expand Down
37 changes: 2 additions & 35 deletions Source/DafnyCore/AST/IHasUsages.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -53,7 +54,7 @@ public static string AsText(this IVariable variable) {
}

public interface ISymbol : IDeclarationOrUsage {
DafnySymbolKind Kind { get; }
SymbolKind Kind { get; }

string GetDescription(DafnyOptions options);
}
Expand All @@ -79,38 +80,4 @@ public static ISet<ISymbol> GetSymbolDescendants(ISymbol node) {
}
return result;
}
}

/// <summary>
/// This is a copy of OmniSharp.Extensions.LanguageServer.Protocol.Models.SymbolKind
/// In the future, we'll include that package in this project, and then this copy can be removed.
/// For now, adding that package reference is not worth its weight.
/// </summary>
keyboardDrummer marked this conversation as resolved.
Show resolved Hide resolved
public enum DafnySymbolKind {
File = 1,
Module = 2,
Namespace = 3,
Package = 4,
Class = 5,
Method = 6,
Property = 7,
Field = 8,
Constructor = 9,
Enum = 10,
Interface = 11,
Function = 12,
Variable = 13,
Constant = 14,
String = 15,
Number = 16,
Boolean = 17,
Array = 18,
Object = 19,
Key = 20,
Null = 21,
EnumMember = 22,
Struct = 23,
Event = 24,
Operator = 25,
TypeParameter = 26,
}
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Members/ConstantField.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -46,7 +47,7 @@ public bool InferredDecreases {
public bool AllowsAllocation => true;

public override IEnumerable<INode> Children => base.Children.Concat(new[] { Rhs }.Where(x => x != null));
public override DafnySymbolKind Kind => DafnySymbolKind.Constant;
public override SymbolKind Kind => SymbolKind.Constant;

public override IEnumerable<INode> PreResolveChildren => Children;
public ModuleDefinition ContainingModule => EnclosingModule;
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Members/Constructor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand All @@ -10,7 +11,7 @@ void ObjectInvariant() {
Contract.Invariant(Body == null || Body is DividedBlockStmt);
}

public override DafnySymbolKind Kind => DafnySymbolKind.Constructor;
public override SymbolKind Kind => SymbolKind.Constructor;
protected override string GetQualifiedName() {
return EnclosingClass.Name;
}
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Members/Field.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -95,7 +96,7 @@ public string GetTriviaContainingDocstring() {
return GetTriviaContainingDocstringFromStartTokenOrNull();
}

public virtual DafnySymbolKind Kind => DafnySymbolKind.Field;
public virtual SymbolKind Kind => SymbolKind.Field;

public string GetDescription(DafnyOptions options) {
var prefix = IsMutable ? "var" : "const";
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Members/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Numerics;
using DafnyCore;
using Microsoft.Dafny.Auditor;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -485,7 +486,7 @@ public string GetTriviaContainingDocstring() {
return null;
}

public DafnySymbolKind Kind => DafnySymbolKind.Function;
public SymbolKind Kind => SymbolKind.Function;
public bool ShouldVerify => true; // This could be made more accurate
public ModuleDefinition ContainingModule => EnclosingClass.EnclosingModuleDefinition;
public string GetDescription(DafnyOptions options) {
Expand Down
5 changes: 3 additions & 2 deletions Source/DafnyCore/AST/Members/ICodeContext.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -93,7 +94,7 @@ public bool InferredDecreases {
public IEnumerable<IToken> OwnedTokens => CwInner.OwnedTokens;
public RangeToken RangeToken => CwInner.RangeToken;
public IToken NameToken => CwInner.NameToken;
public DafnySymbolKind Kind => CwInner.Kind;
public SymbolKind Kind => CwInner.Kind;
public string GetDescription(DafnyOptions options) {
return CwInner.GetDescription(options);
}
Expand Down Expand Up @@ -127,7 +128,7 @@ public IEnumerable<INode> GetConcreteChildren() {
public IEnumerable<IToken> OwnedTokens => throw new cce.UnreachableException();
public RangeToken RangeToken => throw new cce.UnreachableException();
public IToken NameToken => throw new cce.UnreachableException();
public DafnySymbolKind Kind => throw new cce.UnreachableException();
public SymbolKind Kind => throw new cce.UnreachableException();
public string GetDescription(DafnyOptions options) {
throw new cce.UnreachableException();
}
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Members/Method.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Numerics;
using Microsoft.Dafny.Auditor;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -388,7 +389,7 @@ public string GetTriviaContainingDocstring() {
return GetTriviaContainingDocstringFromStartTokenOrNull();
}

public virtual DafnySymbolKind Kind => DafnySymbolKind.Method;
public virtual SymbolKind Kind => SymbolKind.Method;
public string GetDescription(DafnyOptions options) {
var qualifiedName = GetQualifiedName();
var signatureWithoutReturn = $"{WhatKind} {qualifiedName}({string.Join(", ", Ins.Select(i => i.AsText()))})";
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Modules/ModuleDecl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -80,7 +81,7 @@ public virtual string GetTriviaContainingDocstring() {
return GetTriviaContainingDocstringFromStartTokenOrNull();
}

public DafnySymbolKind Kind => DafnySymbolKind.Namespace;
public SymbolKind Kind => SymbolKind.Namespace;
public string GetDescription(DafnyOptions options) {
return $"module {Name}";
}
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Modules/ModuleDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Diagnostics.Contracts;
using System.Linq;
using Microsoft.Dafny.Auditor;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -1046,7 +1047,7 @@ bool InheritsFromObject(TraitDecl traitDecl) {
return Enumerable.Empty<ISymbol>();
});

public DafnySymbolKind Kind => DafnySymbolKind.Namespace;
public SymbolKind Kind => SymbolKind.Namespace;
public string GetDescription(DafnyOptions options) {
return $"module {Name}";
}
Expand Down
3 changes: 3 additions & 0 deletions Source/DafnyCore/AST/Modules/ModuleQualifiedId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public ModuleDecl ResolveTarget(ErrorReporter reporter) {
}

private ModuleDecl ResolveTargetUncached(ErrorReporter reporter) {
if (Root == null) {
return null;
}
var decl = Root;
for (int k = 1; k < Path.Count; k++) {
ModuleSignature p;
Expand Down
2 changes: 2 additions & 0 deletions Source/DafnyCore/AST/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void ObjectInvariant() {
Contract.Invariant(DefaultModule != null);
}

public bool HasParseErrors { get; set; }
public readonly string FullName;

// Resolution essentially flattens the module hierarchy, for
Expand Down Expand Up @@ -52,6 +53,7 @@ public Program(Cloner cloner, Program original) {
SystemModuleManager = original.SystemModuleManager;
Reporter = original.Reporter;
Compilation = original.Compilation;
HasParseErrors = original.HasParseErrors;

if (cloner.CloneResolvedFields) {
throw new NotImplementedException();
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Statements/Assignment/LocalVariable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -130,7 +131,7 @@ public void MakeGhost() {
(Attributes != null ? new List<Node> { Attributes } : Enumerable.Empty<Node>()).Concat(
IsTypeExplicit ? new List<Node>() { OptionalType ?? type } : Enumerable.Empty<Node>());

public DafnySymbolKind Kind => DafnySymbolKind.Variable;
public SymbolKind Kind => SymbolKind.Variable;
public string GetDescription(DafnyOptions options) {
return this.AsText();
}
Expand Down
8 changes: 6 additions & 2 deletions Source/DafnyCore/AST/Tokens.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ string Boogie.IToken.filename {
public class Token : IToken {

public Token peekedTokens; // Used only internally by Coco when the scanner "peeks" tokens. Normally null at the end of parsing
public static readonly Token NoToken = new Token();
public static readonly Token Cli = new Token();
public static readonly Token NoToken = new();
public static readonly Token Cli = new();
public Token() : this(0, 0) { }

public Token(int linenum, int colnum) {
Expand Down Expand Up @@ -218,6 +218,10 @@ public static RangeToken ToRange(this IToken token) {
if (token is BoogieRangeToken boogieRangeToken) {
return new RangeToken(boogieRangeToken.StartToken, boogieRangeToken.EndToken);
}

if (token is NestedToken nestedToken) {
return ToRange(nestedToken.Outer);
}
return token as RangeToken ?? new RangeToken(token, token);
}
}
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/TypeDeclarations/DatatypeCtor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -49,7 +50,7 @@ public string GetTriviaContainingDocstring() {
return GetTriviaContainingDocstringFromStartTokenOrNull();
}

public DafnySymbolKind Kind => DafnySymbolKind.EnumMember;
public SymbolKind Kind => SymbolKind.EnumMember;
public string GetDescription(DafnyOptions options) {
var formals = string.Join(", ", Formals.Select(f => f.AsText()));
return $"{EnclosingDatatype.Name}.{Name}({formals})";
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/TypeDeclarations/DatatypeDecl.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -81,7 +82,7 @@ public override bool IsEssentiallyEmpty() {
}

public override IEnumerable<ISymbol> ChildSymbols => base.ChildSymbols.Concat(Ctors);
public override DafnySymbolKind Kind => DafnySymbolKind.Enum;
public override SymbolKind Kind => SymbolKind.Enum;

public bool SetIndent(int indent, TokenNewIndentCollector formatter) {
var indent2 = indent + formatter.SpaceTab;
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/TypeDeclarations/NonNullTypeDecl.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -45,7 +46,7 @@ public override List<Type> ParentTypes(List<Type> typeArgs) {
return result;
}

public override DafnySymbolKind Kind => Class.Kind;
public override SymbolKind Kind => Class.Kind;

public override string GetDescription(DafnyOptions options) {
return Class.GetDescription(options);
Expand Down
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/TypeDeclarations/SubsetTypeDecl.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.Dafny;

Expand Down Expand Up @@ -48,7 +49,7 @@ public override List<Type> ParentTypes(List<Type> typeArgs) {
}
public bool ShouldVerify => true; // This could be made more accurate
public ModuleDefinition ContainingModule => EnclosingModuleDefinition;
public override DafnySymbolKind Kind => DafnySymbolKind.Class;
public override SymbolKind Kind => SymbolKind.Class;
public override string GetDescription(DafnyOptions options) {
return "subset type";
}
Expand Down
Loading
Loading