Skip to content

Code completion doesn't work on the editor if the import is aliased #2422

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

Closed
clayberg opened this issue Apr 3, 2012 · 12 comments
Closed

Code completion doesn't work on the editor if the import is aliased #2422

clayberg opened this issue Apr 3, 2012 · 12 comments

Comments

@clayberg
Copy link

clayberg commented Apr 3, 2012

[Luke]

Code completion doesn't work on the editor if the import is aliased.

E.g. import dom:html prefix html� html.document. doesn't offer completion.

////////////////////////////////////////////////////////////////////////////////////
Editor Version: 5382
////////////////////////////////////////////////////////////////////////////////////
OS: Mac OS X - x86_64 (10.7.3)
SDK installed = true
Dartium installed = true
////////////////////////////////////////////////////////////////////////////////////
.ast.DartUnit.accept(DartUnit.java:61)
       at com.google.dart.tools.core.internal.indexer.contributor.DartProcessor.process(DartProcessor.java:63)
       at com.google.dart.tools.core.internal.indexer.contributor.DartProcessor.processTarget(DartProcessor.java:87)
       at com.google.dart.indexer.index.IndexTransaction.indexTarget(IndexTransaction.java:115)
       at com.google.dart.indexer.workspace.index.WorkspaceIndexer.indexTarget(WorkspaceIndexer.java:475)
       at com.google.dart.indexer.workspace.index.WorkspaceIndexer.doIndexPendingFiles(WorkspaceIndexer.java:408)
       at com.google.dart.indexer.workspace.index.WorkspaceIndexer.indexPendingFiles(WorkspaceIndexer.java:235)
       at com.google.dart.indexer.workspace.driver.WorkspaceIndexingDriver$IndexingJob.run(WorkspaceIndexingDriver.java:60)
       at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

@clayberg
Copy link
Author

clayberg commented Apr 4, 2012

Added Triaged label.

@stevemessick
Copy link
Contributor

The TypeAnalyzer is always reporting <dynamic> type for anything with a prefix. I converted the clock sample to use a prefix for the html library. (attached) None of the identifiers that have a prefix get a more specific type than <dynamic>. The code is not "under construction"; it is finished and runs fine.


Attachment:
clock.zip (45.42 KB)


Set owner to [email protected].

@DartBot
Copy link

DartBot commented Apr 6, 2012

This comment was originally written by [email protected]


This fixes the dartc side and adds code for the completion engine that can work, but I'm afraid the completion side needs more work.

https://chromiumcodereview.appspot.com/10006030

@DartBot
Copy link

DartBot commented Apr 6, 2012

This comment was originally written by [email protected]


FYI, my repro case that captures one scenario:

$ cat library.dart
#library("library");

class library{
  int instanceField;
  void instanceMethod() {}
  static int staticField;
  static void staticMethod() {}
}

$ cat prefix-completion.dart
#import("library.dart", prefix : "prefix");

main() {
  prefix.library. // cursor here
  print("field is ${prefix.library.field}");
}

@DartBot
Copy link

DartBot commented Apr 6, 2012

This comment was originally written by [email protected]


r6272. dartc change is in. I'm moving over to Steve to finish the job or determine if what's there is good enough.


Set owner to @stevemessick.

@stevemessick
Copy link
Contributor

We're making progress but not quite there yet. I'm running into a problem on line 1226 or Resolver.dart on the following code:

#import('dart:html', prefix: 'html');
f() {var x=new html.Element}

The identifier "html" gets dynamic type. I don't think the resolver should get to line 1226 in this case.


Set owner to [email protected].

@stevemessick
Copy link
Contributor

Added Started label.

@stevemessick
Copy link
Contributor

Marked this as blocking #2539.

@stevemessick
Copy link
Contributor

Marked this as blocking #2616.

@stevemessick
Copy link
Contributor

Marked this as blocking #2617.

@clayberg
Copy link
Author

clayberg commented Jun 5, 2012

Added Fixed label.

@stevemessick
Copy link
Contributor

Marked this as blocking #2617.

This issue was closed.
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

3 participants