dafny-lang / language-server-csharp Goto Github PK
View Code? Open in Web Editor NEWDafny Language Server implementation in C#
License: MIT License
Dafny Language Server implementation in C#
License: MIT License
Moving the .NET projects in this repository into https://github.com/dafny-lang/dafny will make it easier to refactor Dafny without breaking the language server, and make it easier to make changes to the Dafny compilation pipeline that benefit the language server, such as making compilation more incremental.
If you look at a compiler like the C# one (link) you can see that the compiler and language server are integrated into a single repository (example), and I think that makes sense because a big chunk of the compilation, basically the whole front-end of the compilation: parsing, name binding and type inference, validation, relates to the language server as well.
I don’t see significant downsides to including the language server in the Dafny repo. There will be an increase in load time of the Dafny solution, but I think in practice that shouldn’t be an issue.
When requesting a counterexample, an Internal Error is shown in VSCode.
Code:
method test(a: seq<int>) returns (b: seq<int>)
ensures |a| >= |b|
{
return b;
}
Error:
CounterExample request failed: Internal Error - System.ArgumentException: state does not contain position: bug_counterexample.d..(4,0):initial state at Microsoft.Dafny.LanguageServer.Handlers.Custom.DafnyCounterExampleHandler.CounterExampleLoader.GetPositionFromInitialState(IState state) in /Users/runner/work/language-server-csharp/language-server-csharp/Source/DafnyLS/Handlers/Custom/DafnyCounterExampleHandler.cs:line 97 at Microsoft.Dafny.LanguageServer.Handlers.Custom.DafnyCounterExampleHandler.CounterExampleLoader.GetCounterExample(StateNode state) in /Users/runner/work/language-server-csharp/language-server-csharp/Source/DafnyLS/Handlers/Custom/DafnyCounterExampleHandler.cs:line 90 at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items) at System.Collections.Generic.SparseArrayBuilder`1.ReserveOrAdd(IEnumerable`1 items) at System.Linq.Enumerable.SelectManySingleSelectorIt...
Using the Dafny plugin v1.3.0 for VSCode, the assert false
in file F3.dfy below is not highlighted by the IDE. Running Dafny on the command line on file F3.dfy points out the assertion failure.
The setup consists of 3 files: F1.dfy, F2.dfy, and F3.dfy.
F1.dfy:
module M1 {}
F2.dfy:
include "F1.dfy"
F3.dfy:
include "F1.dfy"
include "F2.dfy"
method m()
{
assert false;
}
When deleting either of the include
lines in F3.dfy the assert false
is highlighted. Deleting the include
from F2.dfy also makes the assert false
be detected (after changing and saving F3.dfy). Deleting the module
from F1.dfy also lets the assert false
be detected.
With the release of v3.0.0, the whole release procedure was automized. However, PowerShell's Compress-Archive
command produces ZIP archives whose files do not have any permissions on Unix systems. It is necessary to change how the files are packed for the next release.
I'm using my own locally-built Dafny compiler in the CLI (to include a fix that is still not in any official release).
I can set the VSCode extension to use this compiler (setting ID dafny.compilerRuntimePath
).
Confusingly, after some poking around, looks like this setting is only applied when I use the command dafny.compile
– but not during the rest of the functioning of the extension / language server.
It would be great if this could be unified so the extension always used some specified Dafny installation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.