Skip to content

Class name autocomplete does not suggest local aliases #440

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

Open
weirdan opened this issue Jul 15, 2017 · 2 comments
Open

Class name autocomplete does not suggest local aliases #440

weirdan opened this issue Jul 15, 2017 · 2 comments

Comments

@weirdan
Copy link

weirdan commented Jul 15, 2017

  1. Created new file in an exiting composer project
  2. There's a Zend\Diactoros\ServerRequest class available somewhere in vendor folder
  3. Typed:
    <?php
    namespace zzz;
    use Zend\Diactoros\ServerRequest as SomeRequest;
    
    $q = new SomeReq
  4. Pressed Ctrl+Space
  5. Observed:
    1. 'No suggestions'
    2. In developer console there is suggestion returned, but language server suggests original short class name (ServerRequest in this case):
      [Extension Host] Content-Type: application/vscode-jsonrpc; charset=utf8
      Content-Length: 878
      
      {"result":{"isIncomplete":true,"items":[{"label":"ServerRequest","kind":7,"detail":"Zend\\Diactoros","documentation":"Server-side HTTP request\n\nExtends the Request definition to add methods for accessing incoming data,\nspecifically server parameters, cookies, matched path parameters, query\nstring arguments, body parameters, and upload file information.\n\n\"Attributes\" are discovered via decomposing the request (and usually\nspecifically the URI path), and typically will be injected by the application.\n\nRequests are considered immutable; all methods that might change state are\nimplemented such that they retain the internal state of the current\nmessage and return a new instance that contains the changed state.","sortText":null,"filterText":null,"insertText":null,"textEdit":null,"additionalTextEdits":null,"command":null,"data":null}]},"id":94,"jsonrpc":"2.0"}
      

I suspect either vscode-side extension or vscode itself filters this suggestion out because it doesn't match what has been typed.
Couldn't be local alias returned instead?

Repository owner deleted a comment from duplicate-issues bot Jul 15, 2017
@felixfbecker
Copy link
Owner

Is this still happening?

@weirdan
Copy link
Author

weirdan commented Nov 11, 2018

It does. Menu shows original class name, selecting suggestion inserts alias. However, if original class name doesn't fuzzy-match the typed text, suggestions are filtered, and there's nothing to select from:
image

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

No branches or pull requests

2 participants