Skip to content

использовать версию C# в соответствии с фреймворком#1687

Merged
EvilBeaver merged 2 commits into
EvilBeaver:developfrom
Mr-Rm:feat/LangVersion
May 27, 2026
Merged

использовать версию C# в соответствии с фреймворком#1687
EvilBeaver merged 2 commits into
EvilBeaver:developfrom
Mr-Rm:feat/LangVersion

Conversation

@Mr-Rm
Copy link
Copy Markdown
Collaborator

@Mr-Rm Mr-Rm commented May 26, 2026

Раз используется .NET 8.0, то почему не перейти к C#12?

Summary by CodeRabbit

  • Chores
    • Switched several projects to use the SDK/default C# language version instead of hardcoded values.
    • Clarified language-selection rules: one legacy component constrained to older C#/.NET Framework features, while remaining projects target modern C# on .NET 8.
    • Added an explicit build configuration for a test project to include an additional LinuxDebug configuration.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f35f5c8f-c3b1-44a4-a9f7-86a4a2decfbd

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb6045 and a2d15bd.

📒 Files selected for processing (7)
  • .cursor/rules/langversion.mdc
  • src/OneScript.Web.Server/OneScript.Web.Server.csproj
  • src/OneScriptDocumenter/OneScriptDocumenter.csproj
  • src/Tests/DocumenterTests/DocumenterTests.csproj
  • src/Tests/OneScript.Core.Tests/OneScript.Core.Tests.csproj
  • src/Tests/OneScript.Dynamic.Tests/OneScript.Dynamic.Tests.csproj
  • src/oscommon.targets
💤 Files with no reviewable changes (5)
  • src/OneScript.Web.Server/OneScript.Web.Server.csproj
  • src/Tests/OneScript.Core.Tests/OneScript.Core.Tests.csproj
  • src/Tests/DocumenterTests/DocumenterTests.csproj
  • src/OneScriptDocumenter/OneScriptDocumenter.csproj
  • src/Tests/OneScript.Dynamic.Tests/OneScript.Dynamic.Tests.csproj
✅ Files skipped from review due to trivial changes (1)
  • .cursor/rules/langversion.mdc
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/oscommon.targets

📝 Walkthrough

Walkthrough

Shared build props now use LangVersion = default; codegen rules specify .NET Framework 4.8/C# ≤7.3 for VSCode.DebugAdapter and .NET 8/C# 12 for others; several .csproj files had their explicit <LangVersion> entries removed and one test project added Configurations.

Changes

Build Configuration

Layer / File(s) Summary
Shared default LangVersion
src/oscommon.targets
The <LangVersion> property is changed from 8.0 to default in the shared build properties.
Codegen language rules
.cursor/rules/langversion.mdc
Generator rule updated: VSCode.DebugAdapter uses .NET Framework 4.8 (C# ≤7.3); other projects target .NET 8 (C# 12).
Per-project LangVersion removals and configs
src/OneScript.Web.Server/OneScript.Web.Server.csproj, src/OneScriptDocumenter/OneScriptDocumenter.csproj, src/Tests/DocumenterTests/DocumenterTests.csproj, src/Tests/OneScript.Core.Tests/OneScript.Core.Tests.csproj, src/Tests/OneScript.Dynamic.Tests/OneScript.Dynamic.Tests.csproj
Removed explicit <LangVersion> entries from multiple projects; added a Configurations property (Debug;Release;LinuxDebug) to OneScript.Dynamic.Tests.

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers:

  • EvilBeaver

"I nibble defaults, hop and sing,
Pins loosened make the compilers spring,
Targets set where specifics hide,
A rabbit cheers the build's new stride,
Hooray — the defaults now abide!"

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of the changeset: standardizing C# language versions across projects to align with their target frameworks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/oscommon.targets`:
- Line 9: src/oscommon.targets sets <LangVersion>default with
<TargetFrameworkVersion>net8.0 which promotes all importing projects to C# 12
and may break or warn in many projects; build the solution and either fix C#
12-compatibility issues or explicitly pin LangVersion per-project for those that
must stay on an older compiler. Specifically: run a full build of
src/1Script.sln and all test projects, address any new C#12 errors/warnings (fix
syntax/API uses or adjust code), and for projects that must remain on earlier
versions override <LangVersion> in their .csproj (examples include
VSCode.DebugAdapter.csproj, DocumenterTests.csproj, OneScriptDocumenter.csproj,
OneScript.Dynamic.Tests.csproj, OneScript.Core.Tests.csproj,
OneScript.Web.Server.csproj) or change src/oscommon.targets to a conservative
default; ensure all fixes remove build failures and test regressions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ba7ba74c-56c6-4bf8-9107-d52cc9706edc

📥 Commits

Reviewing files that changed from the base of the PR and between 3c3984c and 1c7e57a.

📒 Files selected for processing (1)
  • src/oscommon.targets

Comment thread src/oscommon.targets
@EvilBeaver
Copy link
Copy Markdown
Owner

Поменяй еще .cursor/rules/langversion.mdc пожалуйста

@Mr-Rm
Copy link
Copy Markdown
Collaborator Author

Mr-Rm commented May 27, 2026

А версии в проектах, найденных Кроликом? Убрать, переключив на общее умолчание?
VSCode.DebugAdapter зафиксирован на 7.3, что уже сейчас противоречит правилу для cursor

@EvilBeaver
Copy link
Copy Markdown
Owner

EvilBeaver commented May 27, 2026

А версии в проектах, найденных Кроликом?

Да, тоже надо привести в порядок, конечно.
Единственное, насчет DebugAdapter не уверен, он ведь под net4 собирается, может там не удастся поднять

@EvilBeaver
Copy link
Copy Markdown
Owner

Класс, спасибо!

@EvilBeaver
Copy link
Copy Markdown
Owner

/rebase

@github-actions github-actions Bot force-pushed the feat/LangVersion branch from 5eb6045 to a2d15bd Compare May 27, 2026 11:45
@EvilBeaver EvilBeaver merged commit 94f66ea into EvilBeaver:develop May 27, 2026
1 check failed
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