Giter Site home page Giter Site logo

dls's People

Contributors

laurenttreguier avatar petarkirov avatar wavefront123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dls's Issues

New release information again and again

When a new DLS version is available, DLS is automatically updated and I get the information in a popup in IntelliJ. The issue is, this dialog is not shown once, but again and again. Maybe related to when DLS or the LSP plugin crashes.
Is this issue related to DLS or should I file an issue for LSP plugin (IntelliJ)?

DLS failing to start

OS: Windows 10 x64
DMD2 is in my path
Fresh install of vscode dls v1.8.1

[Error - 8:31:26 AM] Starting client failed
Error: Unsupported server configuration {
"command": ""
}
at _getServerWorkingDir.then.serverWorkingDir (C:\Users\Damian.vscode\extensions\laurenttreguier.vscode-dls-1.8.1\node_modules\vscode-languageclient\lib\main.js:356:35)
at

Temporary fix for crashing

When a part of DLS fails, such as parsing the file, this is likely not an error that should be considered fatal. Most of the time the file is just incomplete and the parser crashed reading it, and that shouldn't affect your workflow. Just silently ignore the error, and wait for the next file save to parse again. For now, keep the old information from the previous parse.

What about just ignoring parsing errors? As far as I am concerned, the only things that should break DLS completely is formatting. Not even symbol information (IntelliSense).

I don't need that stupid output log popping up when I forget a brace on a block, I shouldn't have to reload VS Code just to get it working again. Don't bother the user with fatal error messages that aren't DLS's fault.

Edit: Since people are probably going to throw fits saying "fatal errors are fatal and shouldn't be ignored", make a setting called "steamroll errors" kind of like FuckItJS. That way people that want to be bothered by annoying unnecessary crash messages still can be.

Dscanner.ini not being used

The returned workspaceUri appears to always be null, so it will always use the default configuration. Appears to reply on _workspaceDependencies which doesn't appear to be set if auto imports is disabled.

https://github.com/d-language-server/dls/blob/master/source/dls/tools/symbol_tool/internal/symbol_tool.d#L584
https://github.com/d-language-server/dls/blob/v0.22.1/source/dls/tools/analysis_tool.d#L358

        const workspaceUri = SymbolTool.instance.getWorkspace(uri);
        immutable workspacePath = workspaceUri is null ? "" : workspaceUri.path;
        return (workspacePath in _analysisConfigs) ? _analysisConfigs[workspacePath]
            : defaultStaticAnalysisConfig();

DCD crash

Every now and then, the underlying dcd crashes. I have to restart vscode to bring it up again.
It would be useful to add a polling to check if dcd is still running and restarting it if it is crashed.

Go to definition with UFCS

The DLS go to definition works fine if a function is being called with the conventional syntax

foo(a, b, c)

However fails if I use the universal function call syntax

a.foo(b, c)

Furthermore, if there is a templated function it (an example from the D programming language)

T[] find(T, E)(T[] haystack, E needle)
    if (is(typeof(haystack[0] != needle) == bool)) {
 ...
}

T1[] find(T1, T2)(T1[] longer, T2[] shorter)
    if (is(typeof(longer[0 .. 1] == shorter) == bool)) {

 ...
}

unittest {
  double[] d1 = [6.0, 1.5, 2.4, 3];
  float[] d2 = [1.5, 2.4];
  find(d, d2);           // <- invoke go to definition here
}

Going to definition shows both versions of find and you must choose between them, but I feel like it should do the same specialization matching the compiler does and go to the second definition.

dls with LanguageClient-neovim

@LaurentTreguier,

I'm trying to use dls 0.8.0 with this LSP server plugin for neovim: https://github.com/autozimu/LanguageClient-neovim. However, I keep getting some errors, so I'm wondering if there's any argument missing to initialize dls or if dls is not compatible with LanguageClient-neovim.

Here's a minimal config, the 'd': ['dls'] line, associates any d source file with this dls command as the LSP client:

set hidden
" Automatically start language servers.
let g:LanguageClient_autoStart = 1
let g:LanguageClient_diagnosticsEnable = 0
let g:LanguageClient_serverCommands = {
    \ 'd': ['dls'],
    \ }

let g:LanguageClient_loggingLevel = 'DEBUG'
let g:LanguageClient_loggingFile = "/tmp/LaguageClient.log"

And, in the logs, there's this "OSerror 20 Not a directory" error whenever I try to use the LSP client functions.

12:40:07 INFO reader-main src/vim.rs:389 <= None {"id": 13, "jsonrpc": "2.0", "result": 1}
12:40:07 ERROR main src/vim.rs:57 Error handling message: Not a directory (os error 20)

Message: {"jsonrpc":"2.0","method":"languageClient/startServer","params":{"buftype":"","cmdargs":[],
"filename":"/home/viniarck/repos/dlang/helloworld/hello.d","languageId":"d"},"id":1}

Error: Os { code: 20, kind: Other, message: "Not a directory" }
12:40:07 INFO main src/vim.rs:90 => None {"jsonrpc":"2.0","error":{"code":-32603,"message":"Not a di
rectory (os error 20)"},"id":1}

I'm positive my current cwd in vim is the project directory of where the d source files are. Do you have idea what might be the issue? Should I set any additional arguments to start dls? I appreciate any tips to run dls with neovim.

Thanks!

importPaths not working in VS Code on Linux

When I add a path to the d.dls.symbol.importPaths setting in VS Code, the extension does not seem to use it when finding symbols. This was working until recently (a couple of weeks ago?), but is not working anymore after either a VS Code update or a dls update.

When I move the source code for the package into the src of my project, everything works as expected.

Slow Code Analysis on Startup

For large codebases this can take a while to run. Especially if there are a lot of errors/warnings it can take up a lot of memory in VS Code. Other IDEs tend to only show this diagnostic data for open files or the currently open file. Possibly adding it as separate functionality to do code analysis on all files? Can't do anything else while this is running either, really annoying on startups.

https://github.com/d-language-server/dls/blob/master/source/dls/tools/analysis_tool.d#L178

Crash on string of cyrillic characters

Reading a file with this code crash the server:

auto b = func("дфкчлсрт") == 12345;

If I remove one char of the string or one digit to the number, there's no crash.

Also I'm using Emacs and "UTF-8".

core.exception.AssertError@/opt/dmd-2.084/import/std/utf.d(447): Past the end of the UTF-16 sequence
----------------
??:? _d_assert_msg [0x78d7230c]
/opt/dmd-2.084/import/std/utf.d:447 pure nothrow @nogc @safe uint std.utf.stride!(const(wchar)[]).stride(ref const(wchar)[], ulong) [0x6e8d1e4d]
/opt/dmd-2.084/import/std/utf.d:992 pure @safe ulong std.utf.toUCSindex!(wchar).toUCSindex(const(wchar)[], ulong) [0x6e8d1d84]
/home/boris/.dub/packages/dls-0.22.3/dls/util/source/dls/util/document.d:213 const dls.protocol.definitions.Range dls.util.document.Document.wordRangeAtLineAndByte(ulong, ulong) [0x6e8c0879]
/home/boris/.dub/packages/dls-0.22.3/dls/source/dls/tools/analysis_tool.d:218 dls.protocol.definitions.Diagnostic[] dls.tools.analysis_tool.AnalysisTool.diagnostics(const(dls.util.uri.Uri)) [0x6e7d367a]
/home/boris/.dub/packages/dls-0.22.3/dls/source/dls/protocol/messages/text_document.d:92 void dls.protocol.messages.text_document.didSave(dls.protocol.interfaces.text_document.DidSaveTextDocumentParams) [0x6e7c9ea9]
/home/boris/.dub/packages/dls-0.22.3/dls/source/dls/protocol/handlers.d:75 void dls.protocol.handlers.pushHandler!(void function(dls.protocol.interfaces.text_document.DidSaveTextDocumentParams)*).pushHandler(const(immutable(char)[]), void function(dls.protocol.interfaces.text_document.DidSaveTextDocumentParams)*).__lambda3(std.typecons.Nullable!(std.json.JSONValue).Nullable) [0x6e75eb84]
/home/boris/.dub/packages/dls-0.22.3/dls/source/dls/server.d:266 void dls.server.Server.handleJSON(const(char[])).findAndExecuteHandler() [0x6e7ce4b7]
/home/boris/.dub/packages/dls-0.22.3/dls/source/dls/server.d:328 void dls.server.Server.handleJSON(const(char[])) [0x6e7ce053]
/home/boris/.dub/packages/dls-0.22.3/dls/source/dls/server.d:178 void dls.server.Server.loop().__lambda1() [0x6e7cde1f]
??:? void core.thread.Fiber.run() [0x78d76e93]
??:? fiber_entryPoint [0x78d7626e]
??:? [0xffffffff]

DLS Fails to compile on Ubuntu 18.04 with dmd-2.088.1

Run the following:

dub fetch dls
dub build --build=release dls

Get the following error:

Building package dls in /home/<user>/.dub/packages/dls-0.25.17/dls/
Fetching dfmt 0.10.1 (getting selected version)...
Fetching libdparse 0.11.6 (getting selected version)...
Fetching dub 1.17.0 (getting selected version)...
Fetching dsymbol 0.6.4 (getting selected version)...
Fetching emsi_containers 0.8.0-alpha.19 (getting selected version)...
Fetching dscanner 0.7.2 (getting selected version)...
Fetching dcd 0.11.1 (getting selected version)...
Fetching stdx-allocator 2.77.5 (getting selected version)...
Fetching msgpack-d 1.0.1 (getting selected version)...
Fetching libddoc 0.6.1 (getting selected version)...
Fetching inifiled 1.3.1 (getting selected version)...
Invalid source/import path: /home/<user>/.dub/packages/dcd-0.11.1/dcd/bin
Running pre-generate commands for dcd...
Invalid source/import path: /home/<user>/.dub/packages/dfmt-0.10.1/dfmt/bin
Running pre-generate commands for dfmt...
Running pre-generate commands for dls:i18n...
Invalid source/import path: /home/<user>/.dub/packages/dscanner-0.7.2/dscanner/bin
Running pre-generate commands for dscanner...
Running pre-generate commands for dls...
std.json.JSONException@std/json.d(1547): Found 'o' when expecting 'u'. (Line 1:2)
----------------
??:? pure @safe void std.json.parseJSON!(immutable(char)[]).parseJSON(immutable(char)[], int, std.json.JSONOptions).error(immutable(char)[]) [0x559f5f723854]
??:? pure @safe void std.json.parseJSON!(immutable(char)[]).parseJSON(immutable(char)[], int, std.json.JSONOptions).checkChar!(false).checkChar(char, bool) [0x559f5f72687f]
??:? pure @safe void std.json.parseJSON!(immutable(char)[]).parseJSON(immutable(char)[], int, std.json.JSONOptions).parseValue(ref std.json.JSONValue) [0x559f5f7244f5]
??:? pure @safe std.json.JSONValue std.json.parseJSON!(immutable(char)[]).parseJSON(immutable(char)[], int, std.json.JSONOptions) [0x559f5f7237ba]
??:? immutable(char)[] data.getVersionFromDescription() [0x559f5f6e2b4b]
??:? _Dmain [0x559f5f6e2708]
Command failed with exit code 1: /home/<user>/.dub/packages/dls-0.25.17/dls/data/data.exe

Poor behavior on malformed dub package description

The following are the outputs gathered from vscode, I make the report in this repo because I don't think this is a problem with the extension itself.

Output when dub.json or dub.sdl is completely empty, this should give a meaningful error message instead:

[Error - 23:07:44] Server initialization failed.
  Message: Internal error
  Code: -32603 
object.Exception@/usr/lib/ldc2/1.17/include/d/std/stdio.d(1074): rawRead must take a non-empty buffer
----------------
stdio.d:1074 @safe ubyte[] std.stdio.File.rawRead!(ubyte).rawRead(ubyte[]) [0x55dfc98d7f9c]
file.d:46 [0x55dfc9b7a8bc]
file.d:42 [0x55dfc9b7a83e]
io.d:40 [0x55dfc9beef65]
package_.d:164 [0x55dfc9bb3b0c]
packagemanager.d:201 [0x55dfc9bb986f]
project.d:66 [0x55dfc9bc66ac]
dub.d:375 [0x55dfc9b1f3a2]
dub.d:367 [0x55dfc9b1f2cb]
symbol_tool.d:1489 [0x55dfc97278c0]
symbol_tool.d:559 [0x55dfc9726953]
symbol_tool.d:532 [0x55dfc9726808]
general.d:83 [0x55dfc976705f]
handlers.d:79 [0x55dfc9827c86]
server.d:251 [0x55dfc97b1c0b]
server.d:328 [0x55dfc97b16f5]
server.d:178 [0x55dfc97b1552]
??:? fiber_entryPoint [0x7f299c25a261]

Output when dub.json contains a single space:

[Info  - 23:10:18] Connection to server got closed. Server will restart.
[Info  - 23:10:18] Connection to server got closed. Server will restart.
[Info  - 23:10:18] Connection to server got closed. Server will restart.
[Info  - 23:10:18] Connection to server got closed. Server will restart.
[Error - 23:10:18] Connection to server got closed. Server will not be restarted.

The server continues to hog two cores even after vscode is closed.

Output when dub.sdl contains a single space and dub.json does not exist:

[Error - 23:13:34] Server initialization failed.
  Message: Internal error
  Code: -32603 
object.Exception@/XXX/.dub/packages/dub-1.17.0/dub/source/dub/recipe/sdl.d(61): /XXX/dub.sdl(0): Error: The package "name" field is missing or empty.
----------------
sdl.d:358 [0x5571e7cb0904]
sdl.d:61 [0x5571e7cb02ce]
sdl.d:25 [0x5571e7cafde0]
io.d:75 [0x5571e7ca11d0]
io.d:43 [0x5571e7ca1039]
package_.d:164 [0x5571e7c65b0c]
packagemanager.d:201 [0x5571e7c6b86f]
project.d:66 [0x5571e7c786ac]
dub.d:375 [0x5571e7bd13a2]
dub.d:367 [0x5571e7bd12cb]
symbol_tool.d:1489 [0x5571e77d98c0]
symbol_tool.d:559 [0x5571e77d8953]
symbol_tool.d:532 [0x5571e77d8808]
general.d:83 [0x5571e781905f]
handlers.d:79 [0x5571e78d9c86]
server.d:251 [0x5571e7863c0b]
server.d:328 [0x5571e78636f5]
server.d:178 [0x5571e7863552]
??:? fiber_entryPoint [0x7fb91f1b4261]

I consider the error message to be acceptable and useful. The stack trace makes it look more dramatic than it is, it should probably be omitted for user-originated mistakes.

Emacs/Vim: server doesn't update text changes

First thanks for this awesome tool!

I'm using emacs with lsp-mode.
For example, if I create a file:

void main() {
    int[] v;
}

then add a line:
v.
and try code completion. I get this error from server (set lsp-print-io variable to get client/server messages):

{
  "error": {
    "code": -32602,
    "data": "dls.protocol.errors.InvalidParamsException@protocol/source/dls/protocol/errors.d(27): Invalid parameters: invalid position: file:///tmp/d/hello.d 2,6\n----------------\n??:? [0x7493c0]\n??:? [0x75238a]\n??:? [0x73a30d]\n??:? [0x4e6e70]\n??:? [0x413109]\n??:? [0x48ddea]\n??:? [0x46105e]\n??:? [0x460b6a]\n??:? [0x733201]",
    "message": "Invalid parameters"
  },
  "id": 118,
  "jsonrpc": "2.0"
}

but if I save the file to disk right at that point and try again it works, completion for alignof, dup, idup, length, etc. appears.
Now editing and trying completion again:

    int[] v;
    v.dup;
    v.

same error.
Looking at the logs there are indeed some "textDocument/didChange" messages with my edits but the server just sees the file as it is on disk.
I also tried Vim with the recommended config but the same behavior happens.

"Internal error"

Just a notification. And that's it. Nothing in output console.

VS Code 1.18.1.

Add option to not create .dub when dub.json or dub.sdl is not used

Some projects (all of mine) don't use Dub. Could we have an option to disable creation of .dub/version.json if the Dub package configuration doesn't exist?

I'm going to just add .dub/ to my .gitignore for now but it would be nice to see this implemented.

Also, thank you for the VS Code extension and the language server! It hasn't crashed on me yet, this is much better than code-d and serve-d.

No completion right after a parenthesis

Due to DCD automatically providing calltips when getting completions right after a parenthesis, no regular completion is currently available this situation.

crash on folders ending with ".d"

System: Ubuntu 18.10, KDE,
Version 1.11.7

log (d.init.logFile)

[2018-Nov-15 09:46:05.089] Initializing server
[2018-Nov-15 09:46:05.089] Importing directories: ["/usr/include/dmd/druntime/import", "/usr/include/dmd/phobos"]
[2018-Nov-15 09:46:06.077] Importing custom project: <some-project-dir>
[2018-Nov-15 09:46:06.077] Importing directories: ["<some-project-dir>"]
[2018-Nov-15 09:46:06.113] Fetching diagnostics for <some-project-dir>/image/etc/ppp/ip-up.d
[2018-Nov-15 09:46:06.113] -32603: std.file.FileException@std/file.d(383): <some-project-dir>/image/etc/ppp/ip-up.d: Is a directory
----------------
??:? [0x741230]
??:? [0x74a41a]
??:? [0x7317fd]
??:? [0x43bee4]
??:? [0x6e3b08]
??:? [0x42a4fa]
??:? [0x42a48d]
??:? [0x48aaa8]
??:? [0x48a562]
??:? [0x48a80c]
??:? [0x48a634]
??:? [0x4965ea]
??:? [0x4a69d1]
??:? [0x49afbc]
??:? [0x49a94b]
??:? [0x404c29]
??:? [0x404845]
??:? [0x73145f]
??:? [0x731355]
??:? __libc_start_main [0x7f56317fa09a]
??:? [0x404768]
[2018-Nov-15 09:46:06.120] Shutting down server
[2018-Nov-15 09:46:06.144] Exiting server

Under Linux some folders end with *.d for directory. Eg resolf.conf.d. It seems to me, that these folders get interpreted as d-files, which leads to an exception. I assume the same issue should occur for all other operating systems.

If you want me to, I can do a pull request.

Thanks for that great language server! It just works and I like it a lot.
Markus

extern(C++, "somestring"): completion and go to definition not working

Completion and go to definition don't work for members of structs like this:

extern (C++,"bar"):
struct Foo
{
    int ab;
    void foo()
    {
        ab = 4; // can't find the definition of ab
    }
}

This is only a problem with the string namespace syntax, and only when applying it with a trailing colon. extern(C++, "bar"), extern(C++, bar): and extern(C++, bar) are all fine.

Log file as command line option

While using dls from generic LSP plugin in IntelliJ it seems I do not have any possibility to set server options. At least the log file would be quite interesting.
Could you add it as command line option?

Can't Go to Declaration for Local Module

Still have the issue. It worked at least once when I tried it but can't get it to work anymore. I uploaded a different project configuration if you want to see if you can reproduce it. It works fine if the "Core" folder is in the workspace directory. But otherwise it doesn't work. Full module imports work as well, but not package.d imports that do public imports eg import Core. Tested with DCD and it works fine there.

dlserror.zip

img

img2

DLS fails to upgrade

This has been a recurring issue for me. Every time there's a new release of DLS, vs-code shows a "Upgrading DSL" notification with an in-progress indicator, but the notification never goes away and the upgrade never completes.

To complete an upgrade, I have to quit vs-code and delete all the directories under ~/.dub/packages/.bin/. After starting vs-code again, DLS installs correctly.

If it helps to diagnose the issue, for this current release under ~/.dub/packages/.bin/ I have a dls-v0.25.13 directory and a dls-v0.25.14 directory. The latter directory is empty. dis-latest points to dls-v0.25.13.

I'm on macOS Mojave 10.14.6 although the same issue has happened to me on earlier versions of macOS too.

Can't Go to Declaration for Local Module

Try to go into "one/a.d" put the cursor somewhere inside "BType" and press F12 (for vscode). It won't find be able to find the symbol. Goto definition works for the std library. Checked the ModuleCache and the two files are in it. Was working in an older version, not sure when it stopped.

test.zip

Huge memory leak since recent versions

OS: Windows 10 x64

Recent DLS versions seem to have a gigantic memory leak. Finding a symbol declaration a few times in a row can increase memory usage by a few dozen megabytes.

dub run dls:bootstrap outputs invalid path

Running dub run dls:bootstrap outputs path
C:\Users\User\AppData\Local\dub\packages\.bin\dls-latest\dls.exe

Folder .bin contains a shortcut with name dls-latest, clicking on this
shortcut shows an error about an invalid path.

DLS failing to start with RangeError

From #7 (comment):

core.exception.RangeError@/Users/travis/dlang/ldc-1.13.0/bin/../import/std/utf.d(448): Range violation
----------------
??:? pure nothrow @nogc @safe int core.internal.string.numDigits!(10u).numDigits(ulong) [0x10de204f9]
??:? pure nothrow @nogc @safe uint rt.cover.max!(uint).max(uint, uint) [0x10de3b96a]
??:? pure nothrow @nogc @safe uint rt.cover.max!(uint).max(uint, uint) [0x10de3c65e]
??:? bool core.demangle.mangle!(int function(scope int delegate(immutable(object.ModuleInfo*)))).mangle(const(char)[], char[]).DotSplitter.__xopEquals(ref const(core.demangle.mangle!(int function(scope int delegate(immutable(object.ModuleInfo*)))).mangle(const(char)[], char[]).DotSplitter), ref const(core.demangle.mangle!(int function(scope int delegate(immutable(object.ModuleInfo*)))).mangle(const(char)[], char[]).DotSplitter)) [0x10de1b671]
??:? pure nothrow @nogc core.exception.InvalidMemoryOperationError core.exception.staticError!(core.exception.InvalidMemoryOperationError).staticError() [0x10de1bf27]
??:? pure @safe ulong std.utf.toUCSindex!(wchar).toUCSindex(const(wchar)[], ulong) [0x10d9afd65]
??:? pure @nogc @safe ulong std.algorithm.iteration.reduce!(dls.util.document.Document.byteAtPosition(const(dls.protocol.definitions.Position)).__lambda2).reduce!(ulong, std.range.iota!(const(ulong), const(ulong)).iota(const(ulong), const(ulong)).Result).reduce(ulong, std.range.iota!(const(ulong), const(ulong)).iota(const(ulong), const(ulong)).Result) [0x10d9a72ed]
??:? void inifiled.readINIFile!(dscanner.analysis.config.StaticAnalysisConfig).readINIFile(ref dscanner.analysis.config.StaticAnalysisConfig, immutable(char)[]) [0x10d89fab0]
??:? std.typecons.Flag!("each").Flag std.algorithm.iteration.each!(dls.tools.analysis_tool.AnalysisTool.scanAllWorkspaces().__lambda1).each!(dls.util.uri.Uri[]).each(dls.util.uri.Uri[]) [0x10d89ef32]
??:? void dls.protocol.handlers.pushHandler!(void function(std.json.JSONValue)*).pushHandler(const(immutable(char)[]), void function(std.json.JSONValue)*) [0x10d8b7039]
??:? void dls.protocol.handlers.pushHandler!(void function(std.json.JSONValue)*).pushHandler(const(immutable(char)[]), void function(std.json.JSONValue)*).__lambda3(std.typecons.Nullable!(std.json.JSONValue).Nullable) [0x10d913f60]
??:? pure nothrow @safe void std.container.dlist.DList!(dls.util.disposable_fiber.DisposableFiber).DList.removeFront() [0x10d8bc65c]
??:? pure @safe ulong std.conv.to!(ulong).to!(immutable(char)[]).to(immutable(char)[]) [0x10d8bbd1f]
??:? nothrow void core.thread.thread_scanAll(scope void delegate(void*, void*) nothrow).__lambda2!(core.thread.ScanType, void*, void*).__lambda2(core.thread.ScanType, void*, void*) [0x10de24913]
[Info  - 1:17:43 PM] Connection to server got closed. Server will restart.

No logs written in case of crash

I use Dls within IntelliJ using LSP plugin. LSP notifies me in case Dls is crashing. Unfortunately the Dls log file does not contain any information about the crash. Actually the log does not even indicate that a crash occurred.

Could you check whether you could write exception stack trace to the log file?

Internal Error

I'm trying this out but it doesn't appear to be working, I see the following errors in the Developer Tools console:

notificationsAlerts.ts:42 Internal error
t.onDidNotificationChange @ notificationsAlerts.ts:42
(anonymous) @ notificationsAlerts.ts:28
e.fire @ event.ts:140
t.notify @ notifications.ts:115
t.notify @ notificationService.ts:54
e._showMessage @ mainThreadMessageService.ts:84
e._showMessage @ mainThreadMessageService.ts:45
e.$showMessage @ mainThreadMessageService.ts:39
t._doInvokeHandler @ rpcProtocol.ts:442
t._invokeHandler @ rpcProtocol.ts:427
t._receiveRequest @ rpcProtocol.ts:344
t._receiveOneMessage @ rpcProtocol.ts:274
(anonymous) @ rpcProtocol.ts:149
e.fire @ event.ts:140
a @ ipc.net.ts:105
n._socketDataListener @ ipc.net.ts:134
emitOne @ events.js:116
emit @ events.js:211
addChunk @ _stream_readable.js:263
readableAddChunk @ _stream_readable.js:250
Readable.push @ _stream_readable.js:208
onread @ net.js:594
console.ts:136 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:136
t._logExtensionHostMessage @ extensionHost.ts:438
(anonymous) @ extensionHost.ts:246
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
mainThreadExtensionService.ts:43 [LaurentTreguier.vscode-dls]Internal error
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
t._doInvokeHandler @ rpcProtocol.ts:442
t._invokeHandler @ rpcProtocol.ts:427
t._receiveRequest @ rpcProtocol.ts:344
t._receiveOneMessage @ rpcProtocol.ts:274
(anonymous) @ rpcProtocol.ts:149
e.fire @ event.ts:140
a @ ipc.net.ts:105
n._socketDataListener @ ipc.net.ts:134
emitOne @ events.js:116
emit @ events.js:211
addChunk @ _stream_readable.js:263
readableAddChunk @ _stream_readable.js:250
Readable.push @ _stream_readable.js:208
onread @ net.js:594
mainThreadExtensionService.ts:44 Error: Internal error
	at handleResponse (/home/gnunn/.vscode/extensions/laurenttreguier.vscode-dls-1.11.6/node_modules/vscode-jsonrpc/lib/main.js:436:48)
	at processMessageQueue (/home/gnunn/.vscode/extensions/laurenttreguier.vscode-dls-1.11.6/node_modules/vscode-jsonrpc/lib/main.js:263:17)
	at Immediate.setImmediate [as _onImmediate] (/home/gnunn/.vscode/extensions/laurenttreguier.vscode-dls-1.11.6/node_modules/vscode-jsonrpc/lib/main.js:247:13)
	at runCallback (timers.js:789:20)
	at tryOnImmediate (timers.js:751:5)
	at processImmediate [as _immediateCallback] (timers.js:722:5)

I've done at dub fetch dls and dub run --arch=x86_64 dls:bootstrap. If I manually run the dls executable it runs fine.

Any suggestions?

DLS crashing

Hello,

Thanks for dls and the vscode extension, it's awesome.

I have a project (evael) where dlsseems to crash with the following error in DLS console :
Connection to server is erroring. Shutting down server.

I really don't know how to fx this myself. Can you give us tips to debug this kind of crashes ?

I'm on Windows 10.
Thanks.

Error in macOS.

dyld: lazy symbol binding failed: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

[Info  - 4:36:36 PM] Connection to server got closed. Server will restart.
dyld: lazy symbol binding failed: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

[Info  - 4:36:36 PM] Connection to server got closed. Server will restart.
dyld: lazy symbol binding failed: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

[Info  - 4:36:36 PM] Connection to server got closed. Server will restart.
dyld: lazy symbol binding failed: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

[Info  - 4:36:36 PM] Connection to server got closed. Server will restart.
dyld: lazy symbol binding failed: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _dyld_enumerate_tlv_storage
  Referenced from: /Users/zoujiaqing/.dub/packages/.bin/dls-latest/dls
  Expected in: /usr/lib/libSystem.B.dylib

[Error - 4:36:36 PM] Connection to server got closed. Server will not be restarted.

Code completion items layout

I am really unsure where to open this issue (DCD, Dls, IntelliJ LSP plugin,...) I assume maybe it fits here.

In the code completion list, the entries which are not selected you can read quite good, as the method name and the method signature have different colors. But the selected item, which is the one you also want to use is quite unreadable. There is some space missing between the method name and the method signature.
image

vim coc support

I tried getting vscode-dlang to work with neovim and coc using
Plug to install it.
Installing seemed to have worked as vscode-dlang was activated by neovim
when opening an .d file.
But dcd-server does not receive any completion requests.

It would be awesome if vscode-dlang would become a first class coc citizen.

Don't Focus Output on Errors

It is really annoying when trying to do something in a terminal and something crashes and the focus is stolen away from whatever it is you were doing. If something goes wrong and it isn't working, then I can go look at the logs manually if I need to.

DLS doesn't pass the Dlang project tester anymore

When it's tested with DMD ~master (buildkite) we got this log:


dls 0.16.0: building configuration "dls-test-library"...
--
  | Linking...
  | .dub/build/dls-test-library-debug-linux.posix-x86_64-dmd_2083-9565891A049306D0F0F224530B8197C2/dls-test-library.o:source/dls/util/uri.d:_D32TypeInfo_E3dls4util9constants2Tr6__initZ: error: undefined reference to '_D3dls4util9constants2Tr6__initZ'
  | collect2: error: ld returned 1 exit status
  | Error: linker exited with status 1
  | dmd failed with exit code 1.
  | 🚨 Error: The command exited with status 2

(linking error due to undefined reference)

Dscanner configuration is not updated when DLS configuration is changed

DLS doesn't look at the new value of d.dls.analysis.configFile when it receives a workspace/didChangeConfiguration message. This is especially problem when using LanguageClient-neovim, which sets the workspace directory (and thereby loads the analysis tool) before sending the configuration. This causes it to effectively ignore the d.dls.analysis.configFile setting.

Static Analysis with No Auto Import

Currently when using No Auto Import configuration, the static analysis done with dscanner will only be done with any open files. Would there be a way to set the path or pattern so that the static analysis is done for the specified files as well? I was having problems where, as part of the Android build files with the extensions '.d' were being generated and would have thousands of errors when dscanner processed them as they aren't actually D source files.

Intellij Idea Plugin

What about of creating Plugin for Intellij Idea? I like how DLS works with VS Code (better plugin among all, which I used) and this great, if Intellij Idea Plugin will be exist too

DLS crashes on incomplete function definition

When I open a file with the following contents:

public void newfunction()

I receive the following error in the Output pane:

core.exception.RangeError@C:\Users\appveyor\AppData\Local\dub\packages\libdparse-0.8.8\libdparse\src\dparse\parser.d(7511): Range violation
----------------
0x000000013F67876D
0x000000013F6784C6
0x000000013F670BCC
0x000000013F6628EC
0x000000013F661212
0x000000013F6616DC
0x000000013F4BDC11
0x000000013F4BF123
0x000000013F4BC188
0x000000013F4B1903
0x000000013F4B1633
0x000000013F3EB2C3
0x000000013F3F1057
0x000000013F3F2FB5
0x000000013F37140D
0x000000013F371019
0x000000013F66204D
0x000000013F661EFA
0x000000013F683218
0x0000000076EA59CD in BaseThreadInitThunk
0x000000007710383D in RtlUserThreadStart
[Info  - 9:22:01 PM] Connection to server got closed. Server will restart.
[Error - 9:22:01 PM] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
	at Object.dispose (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\main.js:825:25)
	at Object.dispose (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-languageclient\lib\client.js:57:35)
	at LanguageClient.handleConnectionClosed (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-languageclient\lib\client.js:2036:42)
	at LanguageClient.handleConnectionClosed (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-languageclient\lib\main.js:153:15)
	at closeHandler (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-languageclient\lib\client.js:2023:18)
	at CallbackList.invoke (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\events.js:71:39)
	at Emitter.fire (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\events.js:135:36)
	at closeHandler (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\main.js:221:26)
	at CallbackList.invoke (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\events.js:71:39)
	at Emitter.fire (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\events.js:135:36)
	at StreamMessageWriter.AbstractMessageWriter.fireClose (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\messageWriter.js:57:27)
	at Socket.<anonymous> (C:\Users\Krendil\.vscode\extensions\laurenttreguier.vscode-dls-1.9.2\node_modules\vscode-jsonrpc\lib\messageWriter.js:79:63)
	at emitOne (events.js:116:13)
	at Socket.emit (events.js:211:7)
	at Pipe._handle.close [as _onclose] (net.js:554:12)

The error message says it occurs within libdparse, but it didn't fail when I tested libdparse in isolation (by putting the bad file in libdparse/test/bad_file and running the test suite), so I'm raising the issue here instead of at the libdparse repository.

I'm using VS Code 1.26.1 on Windows 7 x64, and DLS plugin 1.9.2.

Here is a copy of the file that causes the errors: badfile.zip

(Also, thanks for your hard work!)

Completions not Working for Function Parameters?

There's no completion after typing "(", it doesn't keep the details of the function visible. Also when using Ctrl+Space it doesn't seem to fetch any completions. Most other LSP show the completions of the context of where the cursor is. It seems to just use the default VS Code list instead.

compl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.