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

Serve-d cannot work with local-dependencies #314

Open
AssertionBit opened this issue Apr 8, 2023 · 3 comments
Open

Serve-d cannot work with local-dependencies #314

AssertionBit opened this issue Apr 8, 2023 · 3 comments

Comments

@AssertionBit
Copy link

Specs:

  • NeoVim: v0.9.0-dev-1135+g419819b62
  • Serve-D: 0.8.0-beta13
  • Machine: MacOS M1 Ventura 13.3

Problem

When I working on my project I find out that serve-d is not showing me internal API from other libraries and local too. For example this code is not indexed at all:

import std.stdio; // Works fine
import toml; // Completions gone
import log4d; // Local-Package, completions gone too

auto parsed_data = toml.parse(...); // No documentation & completions
auto logger = new log4d.logger.TerminalLogger(); // Gone too
// dub.sdl

name "marble"
description "Full stack Web development framework for D."
authors "AssertionBit"
copyright "Copyright © 2023, AssertionBit"
license "proprietary"
targetType "sourceLibrary"

dependency "toml" version="~>2.0.1"
dependency "log4d" version="*" path="vendor/log4d"

Logs

Possible issue

Maybe problem in targetType. If Serve-D works with libraries as they are, then it can not compile program at all and receive errors from it. Maybe need to handle all possible Build Types: staticLibrary, sourceLibrary, sharedLibrary. Wrap those formats into abstract main.d and compile like normal.

@WebFreak001
Copy link
Member

yes sourceLibrary is kinda broken because of how it is handled by dub internally. (It's like targetType none, since it doesn't output anything)

Local dependencies should work fine, I think this is just because of the targetType.

When working on such projects I could probably just tell dub it's a regular source library to make it work properly.

@AssertionBit
Copy link
Author

Well, I find out the walk around of it. If pass the dflags in dub.json/dub.sdl the flag.

{
    "dflags": ["-I/vendor/log4d"]
}

Then Serve-D could find a module and handle it normally. Well, it works, but this is still a problem

@AssertionBit
Copy link
Author

Problem is still found in staticLibrary. So this is not problem of the sourceLibrary only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants