Skip to content

Conversation

@devoncarew
Copy link
Contributor

Implement a document symbol provider based on the outline view notification. This is the 'go to symbol' command.

screen shot 2016-08-07 at 5 14 51 pm

@devoncarew
Copy link
Contributor Author

It's ~equivalent to the outline view in other tools, but w/o the UI being persistent (I'm used to using an outline view as an always open bit of UI on the right side of the editor).

subscriptions: { 'OUTLINE': [file] }
});

// TODO: Improve the presentation to make the file structure clearer?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this relate to; all seems fine to me (I think)!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not 100% clear from looking at the list when a member is contained in a class. It's a note to myself - we could remove it as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, I thought you meant the code presentation. Couldn't we prefix with the class name? Or isn't that what the containerName is supposed to do; does it not get rendered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this TODO: - looking at this, I think we're returning the right info from the POV of vscode; we'll rely on them to present things well so that user's can easily navigate the file.

@DanTup
Copy link
Member

DanTup commented Aug 8, 2016

@devoncarew Looks good! I made a comment about parameters which I think would make it better?

Also - the mapping you moved to Analyzer.ts; does it all look good to you? I struggled to map many, so ended up picking fairly randomly (eg. module = compilation unit?!).

@devoncarew
Copy link
Contributor Author

I'll take another spin through this tomorrow -

@DanTup DanTup added this to the v0.7 milestone Aug 8, 2016
@DanTup DanTup modified the milestones: v0.6.2, 0.7 Aug 8, 2016
@devoncarew
Copy link
Contributor Author

I took a look at the mapping - I updated one mapping for an enum_value from a constant to an enum. I'm not sure what a label in the analysis server represents. The other choices look good :) I think this is mostly about mapping things for the purpose of displaying icons, so rough approximations are ok :)

@devoncarew
Copy link
Contributor Author

updated -


let name = element.name;
if (element.parameters)
name = `${name}()`;
Copy link
Member

@DanTup DanTup Aug 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant here was, can't we do name = ${name}${parameters}`` (depending on TS handling of undef/null, it might not even need the if?). This way the results will show the parameters of the method too!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names might get a little long, but it'd be worth experimenting with, to see how it looked. You may also want to see what other language integrations do here -

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah; I'll both compare with TS and see how it looks (and also review the workspace one for consistency, I don't think I added parens or anything there).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I've done in full outline views in the past (where I was concerned about horizontal scrolling), was:

  • fooBar (a field or getter)
  • fooBar() (a method w/o args)
  • fooBar(...) (a method w/ args; the ellipsis is used to save space but indicate that there are params there)

But probably we should just aim for consistency w/ other language integrations into vscode -

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, TS doesn't even show parens on methods!

Typescript

What do you think? Copy, or be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the parens help me know when something's a method vs a field - I guess I'd want to keep those.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a comparison with/without params. I think without is a bit weird (makes them look like they don't have params) however I think without colours the right one is just too busy. Prefer the left?

Params

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the other suggestion:

Elipsis

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good w/ either (the ellipsis or the full params). The full params are useful, if a bit busy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's go with the full params (I guess it's most accurate, even if lack of overloads make it less confusing) and we'll see how it goes. You're likely to use it more/on bigger files than me in the short-term so if you decide it's bad, do shout (or just change).

@DanTup
Copy link
Member

DanTup commented Aug 9, 2016

I can't merge this inline due to conflicts, will do when at PC tonight. I don't mind testing the params change to see how it looks if I get to it before you.

@devoncarew
Copy link
Contributor Author

Merged to master -

@DanTup
Copy link
Member

DanTup commented Aug 9, 2016

I think AppVeyor got an ISE from GitHub downloading the TS defs!

> dart-code@0.6.3-dev postinstall C:\projects\dart-code
> node ./node_modules/vscode/bin/install
Detected VS Code engine version: ^1.4.0
Error installing vscode.d.ts: Error: Request returned status code: 500
Details: Internal Server Error
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.6
npm ERR! npm  v2.15.5

There's nothing like a reliable build system! Forcing a rebuild..

@DanTup
Copy link
Member

DanTup commented Aug 9, 2016

(Currently the only thing it's doing is running the TS compiler, though seeing if I can run automated tests there is on my list; though I'm concerned I might not be able to Code there... we'll see).

Unsurprisingly passes this time. Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants