dotnet / dotnet/vscode-csharp

Partial class go to definition.

Open
#4,312 1 comment 2 reactions 0 assignees View on GitHub
Editor-Go To Definition OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

## Issue Description ##
## Steps to Reproduce ##

1. Create a _partial_ class across several files.
2. Create some mention of the class in another file.
3. Right click on the mention, and click "Go to Definition", or press F12
4. You'll be taken to a file that may or may not represent the "main" file, see my ideal definition below.

## Expected Behavior ##

Go To Reference would go to the "main" file, something like the following lookup:
1. The only file with a constructor in it.
2. / the file with the most constructors in it, if there are multiple.
3. The file with the most methods in it if it is a constructor-less class, etc.

## Actual Behavior ##

I'm not certain, but I believe it just goes to the first file when sorted alphabetically.

## Logs ##

### OmniSharp log ###
Post the output from Output-->OmniSharp log here

### C# log ###
Post the output from Output-->C# here

## Environment information ##

**VSCode version**: 1.52.1
**C# Extension**: 1.23.8

Dotnet Information
.NET SDK (reflecting any global.json):
Version: 5.0.200-preview.20601.7
Commit: b3b934bbf2

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\

Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7

.NET SDKs installed:
3.1.102 [C:\Program Files\dotnet\sdk]
3.1.302 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
5.0.100 [C:\Program Files\dotnet\sdk]
5.0.200-preview.20601.7 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions

|Extension|Author|Version|
|---|---|---|
|better-align|wwm|1.1.6|
|csharp|ms-dotnettools|1.23.8|
|erlang-otp|yuce|0.2.4|
|errorlens|usernamehw|3.2.4|
|githistory|donjayamanne|0.6.14|
|gitignore|codezombiech|0.6.0|
|graphql-for-vscode|kumar-harsh|1.15.3|
|hexeditor|ms-vscode|1.3.0|
|jsdoc-markdown-highlighting|bierner|0.0.1|
|markdown-all-in-one|yzhang|3.4.0|
|msbuild-project-tools|tintoy|0.3.10|
|partial-diff|ryu1kn|1.4.1|
|path-intellisense|christian-kohler|2.3.0|
|powershell-preview|ms-vscode|2020.9.0|
|rainbow-csv|mechatroner|1.8.0|
|remote-ssh-edit|ms-vscode-remote|0.62.0|
|remote-wsl|ms-vscode-remote|0.52.0|
|selected-lines-count|gurumukhi|1.4.0|
|sqltools|mtxr|0.23.0|
|svg|jock|1.4.2|
|template-string-converter|meganrogge|0.4.4|
|theme-karyfoundation-themes|karyfoundation|20.0.3|
|todo-tree|Gruntfuggly|0.0.192|
|toml|be5invis|0.5.1|
|unique-lines|bibhasdn|1.0.0|
|vscode-docker|ms-azuretools|1.9.0|
|vscode-eslint|dbaeumer|2.1.14|
|vscode-great-icons|emmanuelbeziat|2.1.62|
|vscode-json5|mrmlnc|1.0.0|
|vscode-scss|mrmlnc|0.9.0|
|vscode-scss-formatter|sibiraj-s|2.0.5|
|vscode-solution-explorer|fernandoescolar|0.3.11|
|vscode-yaml|redhat|0.13.0|
|xml|DotJoshJohnson|2.5.1|;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.