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

Custom object.d should be included by default #688

Open
ryuukk opened this issue Oct 19, 2022 · 0 comments
Open

Custom object.d should be included by default #688

ryuukk opened this issue Oct 19, 2022 · 0 comments

Comments

@ryuukk
Copy link
Contributor

ryuukk commented Oct 19, 2022

Right now, only the default object.d is automatically included for implicit code completion

But when developing custom runtimes, a custom object.d is used to overwrite the default one, the problem is DCD only expect one object module from the default runtime

I suspect the problematic code is here:

override void visit(const Module mod)
{
rootSymbol = allocateSemanticSymbol(null, CompletionKind.moduleName,
symbolFile);
currentSymbol = rootSymbol;
moduleScope = GCAllocator.instance.make!Scope(0, uint.max);
currentScope = moduleScope;
auto objectLocation = cache.resolveImportLocation("object");
if (objectLocation is null)
warning("Could not locate object.d or object.di");
else
{
auto objectImport = allocateSemanticSymbol(IMPORT_SYMBOL_NAME,
CompletionKind.importSymbol, objectLocation);
objectImport.acSymbol.skipOver = true;
currentSymbol.addChild(objectImport, true);
currentScope.addSymbol(objectImport.acSymbol, false);
}
foreach (s; builtinSymbols[])
currentScope.addSymbol(s, false);
mod.accept(this);
}

It should be able to differentiate the object.d from the runtime from the custom one

  • DCD should be able to create a list of every object modules
  • if just one object module, easy use it
  • if more than 1 object modules found, then ignore the one that comes from the runtime
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

Successfully merging a pull request may close this issue.

1 participant