better-cpp-syntax icon indicating copy to clipboard operation
better-cpp-syntax copied to clipboard

noexcept getting different scopes

Open alexr00 opened this issue 5 years ago • 3 comments

Checklist

  • [ ] This problem exists even with the setting "C_Cpp.enhancedColorization": "Disabled"
  • [ ] This bug exists for C
  • [x] This bug exists for C++
  • [ ] This bug exists for Objective-C
  • [ ] This bug exists for Objective-C++

The code with a problem is:

#pragma once

#include "../StandardIncludes.h"

class FillComponent : public juce::Component {
  public:
	explicit FillComponent(juce::Colour color) noexcept;

	auto paint(juce::Graphics& g) noexcept -> void override;

	inline auto setColor(juce::Colour color) noexcept -> void {
		mColour = color;
	}

	inline auto getColour() const noexcept -> juce::Colour { // The noexcept on this line gets a different scope
		return mColour;
	}

#if defined(PACE_ENABLED)
	DECLARE_SECURITY_FUNCTIONS();
#endif

  private:
	juce::Colour mColour;

	JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(FillComponent)
};

It looks like:

The noexcept on the line with the comment gets the following scopes: variable.other.object.access.cpp meta.head.function.definition.cpp meta.function.definition.cpp meta.body.class.cpp meta.block.class.cpp source.cpp

However, the other noexcepts have these scopes: keyword.operator.noexcept.cpp keyword.operator.wordlike.cpp meta.head.function.definition.cpp meta.function.definition.cpp meta.body.class.cpp meta.block.class.cpp source.cpp

image

It should look like:

I would expect all noexcepts to have the same or similar scopes. However, I am not expert on noexcept.

Originally from @braxtons12 in https://github.com/microsoft/vscode/issues/107172

alexr00 avatar Sep 29 '20 10:09 alexr00

Are there any plans to eventually fix this issue?

AlexB8675 avatar May 09 '25 20:05 AlexB8675

probably not TextMate is currently being abandoned

RedCMD avatar May 11 '25 02:05 RedCMD

I can't speak for cpp specifically, but we don't plan to abandon TextMate within VS Code.

alexr00 avatar May 12 '25 08:05 alexr00