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

Files with a '#' character can't be opened when an error occurs ('Problems' menu) #136588

Closed
Jiogo18 opened this issue Nov 6, 2021 · 8 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues verified Verification succeeded
Milestone

Comments

@Jiogo18
Copy link

Jiogo18 commented Nov 6, 2021

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.62.0
  • OS Version: Windows 10
  • Extensions: Debugger (C# and C/C++ from Microsoft)

Steps to Reproduce:

  1. Create a Workspace with a '#' in the path
  2. Create a project (C# or C++) which contains an intentional error
  3. Run the project, the "error" occurs (this is normal, we wanted it)
  4. Open the 'Problems' menu, the file with the "error" can't be opened because the path is cut before the '#'

Example:

I create a project with C:\Code\C#\tools\main.cpp

#include <iostream>
int main()
{
	std::cout << "Hello world!" << std::endl;
	int foo = "bar";
	return 0;
}

Then I execute the project using VS Code (with tasks.json and launch.json) to get the "error" ("bar" can't be converted to int, legit)

  • What happens:
    I got the "error", but the path is C:\Code\C and I can't open it because this file doesn't exist.
    image
  • What I expected:
    When I rename the folder C# to CS, the "error" opens C:\Code\CS\tools\main.cpp as expected.
    image

I guess this also happens for '?' characters, but I can't test it on Windows.

@gifhupp
Copy link

gifhupp commented Nov 6, 2021

#include
int main()
{
std::cout << "Hello world!" << std::endl;
int foo = "bar";
return 0;
}

@jrieken
Copy link
Member

jrieken commented Nov 8, 2021

This works just fine with TypeScript and other extension. It must be a case of double encoding/decoding with the C++ extension. Please forward this issue to them

Screen Shot 2021-11-08 at 12 13 25

@jrieken
Copy link
Member

jrieken commented Nov 8, 2021

/extCpp

@jrieken jrieken reopened this Nov 8, 2021
@jrieken
Copy link
Member

jrieken commented Nov 8, 2021

Re-open, need to know where the problem definition comes from. @Jiogo18 Is that your own problem matcher or one from the extension?

@jrieken jrieken added info-needed Issue requires more information from poster and removed *caused-by-extension Issue identified to be caused by an extension labels Nov 8, 2021
@Jiogo18
Copy link
Author

Jiogo18 commented Nov 8, 2021

Ok, so without the C++ extension, the task can't be executed (and I don't know how to link a local gcc with problemMatcher).
But in C# we don't need the extension to run the task, and the same thing happens :

{
"label": "build",
"command": "msbuild",
"problemMatcher": "$msCompile"
},

(created with dotnet new console)

using System;
namespace Calendar
{
	class Program
	{
		static void Main(string[] args)
		{
			Console.WriteLine("Hello world!");
			Console.WriteLine(this_is_a_non_defined_variable_to_do_an_error);
		}
	}
}

image

And the build has the full path:
image

@jrieken jrieken reopened this Nov 8, 2021
@jrieken
Copy link
Member

jrieken commented Nov 8, 2021

Adding @alexr00 for the problem matcher specifics

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tasks Task system issues and removed info-needed Issue requires more information from poster new release labels Nov 8, 2021
@alexr00 alexr00 added this to the November 2021 milestone Nov 8, 2021
@alexr00 alexr00 closed this as completed in 0600ecc Nov 8, 2021
@jrieken jrieken added the verified Verification succeeded label Dec 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@jrieken @Jiogo18 @alexr00 @gifhupp and others