ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.36k stars 2.8k forks source link

Add instructions for use with .NET 6.0 #4205

Closed dkaszews closed 6 months ago

dkaszews commented 6 months ago

PR Prelude

Thank you for working on YCM! :)

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your PR:

Why this change is necessary and useful

Adds instructions for using YCM with .NET 6.0 and newer, as it is currently not supported out of the box and configuring it has difficult to diagnose gotchas. Switching defaults to .NET 6.0 version of OmniSharp-Roslyn for out-of-the-box support breaks a bunch of tests in ycmd, lacking resources to fix.

Removal of necessisity for solution files is possible, but requires some future work as YCM internally associates files with their solutions and therefore OmniSharp server instances; removing them causes issues.

After merge, add the following to FAQ linking to the new section:

Q: My C# projects compile, but YCM shows false-positive syntax errors A: You may be trying to use features from .NET 6.0 or newer, which is not supported out of the box, see [README]()

Q: My C# projects compile without solution files, but YCM just shows "Missing solution file": A: YCM currently uses solution files for internal bookkeeping, see [README]()

Q: YCM only provides autocomplete for C# system modules, but not for any nuget dependencies A: Your solution file may be missing references to some projects, see [README]()

Q: YCM shows my C# file is fine, but it fails to actually compile A: Your solution file may be missing references to some projects, see [README]()

No tests - documentation only.


This change is Reviewable

codecov[bot] commented 6 months ago

Codecov Report

Merging #4205 (79e3753) into master (302d41e) will increase coverage by 1.07%. The diff coverage is n/a.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4205 +/- ## ========================================== + Coverage 88.82% 89.90% +1.07% ========================================== Files 34 34 Lines 4404 4408 +4 ========================================== + Hits 3912 3963 +51 + Misses 492 445 -47 ```
puremourning commented 6 months ago

Vim tests now failing?

dkaszews commented 6 months ago

Don't really know how to read the logs, which errors are expected and which not, but it kinda looks like the error is in a C++ test around line 34000, so unlikely to be caused by my most recent changes.

Easiest diagnostic step would be to trigger tests for each of the new ycmd commits, can't do it myself since this is my first commit to this repo.

puremourning commented 6 months ago

Looks like a slight change in the diagnostics output :

command line..script /__w/YouCompleteMe/YouCompleteMe/test/lib/run_test.vim[402]..function RunTheTest[68]..Test_ShowDetailedDiagnostic_CmdLine line 9: Expected 'Format specifies type ''char *'' but the argument has type ''int'' (fix available)' but got 'Format specifies type ''char *'' but the argument has type ''int'' (fix available) [-Wformat]'

Likely caused by:

https://github.com/ycm-core/ycmd/pull/1720 - Provide diagnostic kind in detailed diagnostic.

puremourning commented 6 months ago

pushed a fix

puremourning commented 6 months ago

OK it seems the problems are more deep rooted!

puremourning commented 6 months ago

ok, fixed a ton more issues

bstaletic commented 6 months ago

Looks like Test_Completion_FixIt() is still broken...

Found errors in Test_Completion_FixIt(). Retrying.
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check1[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_a_thing(Thing thing)" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check1[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_another_thing()" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check2[2]..CheckCurrentLine line 1: Expected 'do_a_thing' but got 'std::memory_order_acquire'
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check2[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_a_thing(Thing thing)" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check2[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_another_thing()" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check3[2]..CheckCurrentLine line 1: Expected 'do_a_thing(' but got 'std::memory_order_acquire('
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check3 line 3: Expected '#include "auto_include.h"' but got '#include <atomic>'
puremourning commented 6 months ago

Looks like Test_Completion_FixIt() is still broken...

Found errors in Test_Completion_FixIt(). Retrying.
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check1[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_a_thing(Thing thing)" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check1[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_another_thing()" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check2[2]..CheckCurrentLine line 1: Expected 'do_a_thing' but got 'std::memory_order_acquire'
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check2[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_a_thing(Thing thing)" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check2[3]..CheckCompletionItemsHasItems line 15: Didn't find item with abbr="do_another_thing()" in completion list: ['std::memory_order_acquire', 'std::memory_order_acq_rel', 'std::atomic_thread_fence(memory_order m)', 'std::memory_order_relaxed', 'std::memory_order_release']
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check3[2]..CheckCurrentLine line 1: Expected 'do_a_thing(' but got 'std::memory_order_acquire('
function RunTheTest[68]..Test_Completion_FixIt[36]..FeedAndCheckMain[2]..Check3 line 3: Expected '#include "auto_include.h"' but got '#include <atomic>'

but.. only on old vim ._0

bstaletic commented 6 months ago

Green as well!

mergify[bot] commented 6 months ago

Thanks for sending a PR!