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

C# Attributes #662

Closed
DeNelo opened this issue Aug 13, 2015 · 7 comments
Closed

C# Attributes #662

DeNelo opened this issue Aug 13, 2015 · 7 comments

Comments

@DeNelo
Copy link

DeNelo commented Aug 13, 2015

(EDIT: And when I say attribute, I mean annotation... sorry)
In C#, decorating with annotations goes unnoticed by the parser. For instance, in:

[RemotableService]
[TaskDefinition("RightName", 
/*!localizationId*/"RightDescription.",/*!localizationId2*/"LocalRightName")]
public class RemotableExample : IRemotableExample
{
  ...

-the "[RemotableService]" annotation does not get colored at all.
In "[TaskDefinition(...]", the word TaskDefinition gets colored, but not the [.
Is there anything to do about that..?

@Golmote
Copy link
Contributor

Golmote commented Aug 13, 2015

@mvalipour Could you take a look?

@nauzilus
Copy link
Contributor

I've also noticed it doesn't highlight generics:

public void Foo() { Bar(); }
public void Foo<T>() { Bar<T>(); }

The method name and invocation will highlight on the first line, but not the second.

I started to look into these a while ago but got busy :(

I'll try and have a look again if I can get time (and it's not tended to in the meantime).

@mvalipour
Copy link
Contributor

well, attribute selection is going to be tricky because there can be confusion between [Attribute] and
c#6's dictionary initialization:

var dic = new Dictionary<string, string> {
    [key] = value,
    [key2] = value2
}

for generics tho, it should be fine. do you guys agree?

@Golmote
Copy link
Contributor

Golmote commented Aug 15, 2015

@mvalipour: Can you submit a PR if you think you can improve the current highlighting?

@mvalipour
Copy link
Contributor

I'm happy to do so, however, what I'm trying to figure out is that this is something within the possibilities of prism. -- to my understanding, prism is very limited in terms of syntaxes it can find (given it doesn't parse the code and purely relies on regular expressions).

I had a quick look and nothing seems to be done around for example templates in cpp (which are the equivalent of c# generics)

@Golmote
Copy link
Contributor

Golmote commented Aug 15, 2015

Regexp are powerful though. The idea here is trying to achieve the best possible result using them. :)

@Golmote
Copy link
Contributor

Golmote commented Apr 8, 2018

Fixes for #1365 and #1371 seem to have fixed this issue too, so i'm closing it.

@Golmote Golmote closed this as completed Apr 8, 2018
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

4 participants