Visual D issues and suggestions

Rainer Schuetze r.sagitario at gmx.de
Mon Oct 22 17:50:04 UTC 2018



On 21/10/2018 12:11, John Chapman wrote:
> Rainer, you may have a lot of these on your to-do list, but I've been
> noting some of the minor issues I've come across using Visual D and it
> might be useful for future releases.

Thank you for this extensive list.

> 
> Fixes:
> * The Intellisense list for __traits needs updating inline with the spec.
> * Remove obsolete "classinfo" from completion list.
> * Add "typeof" keyword to completion list.
> * Show completion list when typing UDA> * Support new contract expressions (and upcoming mixin tuple syntax).

I will have to delegate most of these to the author of the semantic
engine. Fortunately he has continued to work on it after a couple of years.

> * Indent function bodies correctly when generating overrides.

I guess you mean indentation if "override" is on the line before the
function declaration? That happens for any function attribute (or even
type) if it is on a separate line (C# does the same).
I was considering integrating dfmt at some point but it seems formatting
just a selection doesn't work too well with it.

> * Indenting for enum members is sometimes too much.

Can you provide an example?

> * Tooltips on token-string literals adds a lot of extra spacing between
> symbols.

You mean the space between each token? Yes, that's bad. It should be
shown as is.

> * Tooltips that show documentation can have excessive line breaks.

I haven't found a way to format tooltips better than just plain text.
What you see is more or less how it is written in the source code.

> * Tooltips on variables repeat attributes - eg, "private int length;"
> produces "private private(int) [parent].length" instead of perhaps
> "(variable) private int [parent].length".

I recently stumbled over a strange extern(function_name), too. I'll look
into that.

> * Remove duplicated/disabled entries for "New filter"/"New folder" in
> Solution Explorer > context menu > Add.

These are two slightly different items: "filter" is what you get in a
C++ project, "folder" is a package and similar to C#.

> * Fix Visual D Search text boxes and buttons for high DPI displays.

Ok, I've tried Visual D on a HiDPI screen yet.

> 
> Suggestions:
> * Add option to not indent switch case labels.

In the long run, it should probably follow dfmt's .editorConfig options
(no idea if there is something about switch/case in there, though).

> * Add refactoring/renaming support.

That's a tough one as it requires almost flawless semantic analysis...
See also https://issues.dlang.org/show_bug.cgi?id=13925

> * When insertion point is inside variable or type name, highlight usages.

Hopefully possible soon, see "Colorize type names".

> * For Visual D projects, include option to compile/link in single step.

What's wrong with the "General->Compilation" option?

> * Automatically include modules in the current project as candidates for
> completion - I seem to have to add my project folders to Visual D
> Settings > DMD Directories > Import paths

You should not have to add that to a global option. If your source files
are not in the same folder as the project file, you might have to add
the source folder to the project import paths.

> * Colourise type names and UDAs in editor.

This is currently work in progress.

> * C#-style formatting and colourisation in tooltips.

See comment about tooltips above.

> * Ctrl-click for "Go to definition".

I'll have to investigate how a language service is supposed to support that.

> * When user declares variables, suggest possible names based on type -
> eg, a variable of type "FontFaceReference" pops up a list including
> "fontFaceReference", "fontFace" and "reference".

Interesting gimmick.

> * Fade out unused imports.

Again, good semantic analysis is needed.
See also https://issues.dlang.org/show_bug.cgi?id=13913

> Hope this is useful.

It is, thanks again. I'll try to get 0.48.0 out of the door before
starting to work on new stuff. Do you still have trouble with the beta
with respect to crashes (probably due to static foreach)? Can you
provide a test case?


More information about the Digitalmars-d-ide mailing list