JetBrains / JetBrains/resharper-devguide

Additional code samples for Macros (or others) would be nice

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
74
Forks
36
PR merge metrics
No merged PRs in 30d

Description

I've recently started developing a plugin to infer the return type of an expression and provide that as auto completion options. Apart from me thinking that this would be a nice macro for resharper to provide by default, i found this rather difficult to develop.

I have used these docs for guidance:

// http://blog.jetbrains.com/dotnet/2010/10/14/templates-galore-extending-functionality-with-macros/
// http://confluence.jetbrains.com/display/NETCOM/4.04+Live+Template+Macros+%28R8%29
// https://www.jetbrains.com/resharper/devguide/Features/LiveTemplates/Macros.html

While those samples provide a very thorough explanation of what is what and how it works,i find it rather difficult to really "guess" how to actually implement my feature.

Thats why i want to suggest you share more actual code samples. While the existing documentation is good to develop simple features it seems rather difficult to develop something which is not closely resembled by the provided samples already.

Would providing actual source code of resharper macros be an option? I think especially areas where customization extensions are probable this could be very useful.

Because essentially my macro will do pretty much the same as the "suggest type" macro. However that macro does not work for me because it breaks the c# syntax in the way i'm trying to use it, because its default placeholder seems to be an empty string. Just to elaborate: i know this is not the bug tracker for resharper itself:

public $GUESSTYPE$ $NAME$ => $SOMEEXPRESSION

parameter order $NAME$, $SOMEEXPRESSION$, $GUESSTYPE$

If i could look into the "suggest type" macro, fixing up the behavior of the macro to provide "object" as default placeholder would be a very simple task.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked Live Template Macros documentation and the existing “suggest type” macro guidance mentioned in the issue. Identify where current examples stop short of showing real macro implementations. Done means the developer guide contains additional practical source examples for macros or clearly documents how to extend the existing samples.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.