Skip to content

[Feat] Have option to use tabs instead of spaces (forced override)#267

Merged
jdneo merged 8 commits into
microsoft:mainfrom
jomillerOpen:main
Jun 4, 2026
Merged

[Feat] Have option to use tabs instead of spaces (forced override)#267
jdneo merged 8 commits into
microsoft:mainfrom
jomillerOpen:main

Conversation

@jomillerOpen
Copy link
Copy Markdown
Contributor

Read the default text editor preferences from Eclipse instead of defaulting to spaces by default. To avoid having additional plug-in dependencies, we use the existing preferences plug-in to check the multiple workspace instances for the settings. The 2 settings are the "spacesForTabs" and "tabWidth". If those settings are found, we will use those for the formatting options. If not, then it will continue to fall back to using defaults of using spaces. These settings are in effect when a project is neither a Java or C project type.

Read the default text editor preferences from Eclipse instead of defaulting to spaces by default.
Copilot AI review requested due to automatic review settings May 28, 2026 13:25
@jomillerOpen
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="OpenText"

@jomillerOpen
Copy link
Copy Markdown
Contributor Author

Implements/satisfies #238

Switch to using the Platform.getPreferencesService() method instead, which will correctly account for the instances.
@jomillerOpen
Copy link
Copy Markdown
Contributor Author

I didn't know about that until now! But yes, I tried using it and it seems to work find as well. I'll switch it to that.

@jdneo
Copy link
Copy Markdown
Member

jdneo commented Jun 1, 2026

@jomillerOpen Looks good! Please fix the test failure, thank you.

FormatOptionProviderTests.testGetCopilotDefaultTabCharAndSizeForUnknownLanguage:59 expected: but was:

@jdneo
Copy link
Copy Markdown
Member

jdneo commented Jun 2, 2026

CI still failed, pls refer to #273

Return the Eclipse settings when the file isn't part of a project or doesn't have an extension.
@jomillerOpen
Copy link
Copy Markdown
Contributor Author

There we go. Passed locally. Had to return the Eclipse options for the 2 other scenarios where a file isn't part of a handled project.

Updated test to set the preferences and then test.
Copy link
Copy Markdown
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for your contribution!

@jdneo jdneo merged commit 3673890 into microsoft:main Jun 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants