Skip to content

Add common C# keywords and functions to Talon lists - #2225

Open
Mark-Phillipson wants to merge 4 commits into
talonhub:mainfrom
Mark-Phillipson:add/csharp-code-keywords
Open

Add common C# keywords and functions to Talon lists#2225
Mark-Phillipson wants to merge 4 commits into
talonhub:mainfrom
Mark-Phillipson:add/csharp-code-keywords

Conversation

@Mark-Phillipson

Copy link
Copy Markdown
Contributor

This pull request introduces a new Talon list file that contains the C# keywords. Additionally, it moves the common functions related to C# into a Talon list to improve organization and accessibility. These changes aim to enhance the overall functionality for users working with C# in Talon.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: abe99cb597

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lang/csharp/code_common_function.talon-list Outdated
Comment thread lang/csharp/code_keyword.talon-list Outdated

@FireChickenProductivity FireChickenProductivity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am glad to see someone else helping expand our language support!

It is generally recommended to put separate features in separate pull requests for the reasons outlined in the CONTRIBUTING.md file. That would probably get one of your list changes merged faster.

Comment thread lang/csharp/csharp.py
code.language: csharp
"""

mod.list("code_common_function", desc="Common C# functions")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should not be redefining these lists on a module.

Comment on lines +7 to +8
string: ".ToString"
length: ".Length"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We usually use user.code_common_method for methods.

@@ -0,0 +1,90 @@
list: user.code_keyword
code.language: csharp
code.language: aspnetcorerazor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can code.language get set to this if we do not have the language defined in Community? Can you check if this triggers with help scope? code.language is under Misc if a language is detected.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

From the community backlog session — we are aware that this is in another PR. Consider removing code.language: aspnetcorerazor until we have a decision on that PR.

@@ -0,0 +1,90 @@
list: user.code_keyword
code.language: csharp
code.language: aspnetcorerazor

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

From the community backlog session — we are aware that this is in another PR. Consider removing code.language: aspnetcorerazor until we have a decision on that PR.

Comment on lines +6 to +90
abstract: " abstract "
add: " add "
alias: " alias "
ascending: " ascending "
async: " async "
await: " await "
base: " base "
boolean: " bool "
break: " break "
case: " case "
catch: " catch "
class: " class "
const: " const "
continue: " continue "
default: " default "
delegate: " delegate "
descending: " descending "
double: " double "
dynamic: " dynamic "
else: " else "
enum: " enum "
equals: " equals "
event: " event "
explicit: " explicit "
extern: " extern "
false: " false "
finally: " finally "
for: " for "
foreach: " foreach "
from: " from "
get: " get "
global: " global "
group: " group "
if: " if "
implicit: " implicit "
in: " in "
integer: " int "
interface: " interface "
internal: " internal "
into: " into "
is: " is "
join: " join "
let: " let "
lock: " lock "
name of: " nameof "
namespace: " namespace "
new: " new "
null: " null "
operator: " operator "
order by: " orderby "
out: " out "
override: " override "
params: " params "
partial: " partial "
private: " private "
protected: " protected "
public: " public "
read only: " readonly "
ref: " ref "
remove: " remove "
required: " required "
return: " return "
sealed: " sealed "
select: " select "
set: " set "
size of: " sizeof "
static: " static "
string: " string "
struct: " struct "
switch: " switch "
this: " this "
throw: " throw "
true: " true "
try: " try "
type of: " typeof "
unsafe: " unsafe "
using: " using "
value: " value "
var: " var "
virtual: " virtual "
volatile: " volatile "
void: " void "
where: " where "
while: " while "
yield: " yield "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

From the community backlog session — our general pattern is not to include leading spaces in user.code_keyword (operators like "and" and "or" are rare exceptions). Only include trailing spaces where there is always expected to be something after it (not including punctuation like commas or semicolons).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T00:05:26.062775Z 30a507b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added lines/50-199 Pull request changes 50 to 199 lines review/updated-after-changes-requested New commits were pushed after changes were requested labels Sep 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30a507bb7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lang/csharp/csharp.py
Comment on lines +13 to +14
mod.list("code_common_function", desc="Common C# functions")
mod.list("code_keyword", desc="Common C# keywords")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the duplicate global list declarations

These lists are already declared as user.code_common_function in lang/tags/functions_common.py:6 and user.code_keyword in lang/tags/keywords.py:7. Because Talon module declarations share the user namespace, redeclaring them from a second module causes whichever declaration is registered second to fail; depending on load order, this can prevent either the C# action overrides or the shared keyword/common-function support from loading.

Useful? React with 👍 / 👎.

integer: "int.TryParse"
print: "Console.WriteLine"
string: ".ToString"
length: ".Length"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the Length property out of the function list

When a C# user invokes funk length for a standard string or array, UserActions.code_insert_function unconditionally appends parentheses, so this entry inserts .Length() rather than the valid .Length property access. This command therefore produces uncompilable C# for the common types the entry is intended to support.

Useful? React with 👍 / 👎.

@@ -0,0 +1,90 @@
list: user.code_keyword
code.language: csharp
code.language: aspnetcorerazor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Activate keyword commands for Razor contexts

When VS Code reports code.language: aspnetcorerazor, this list becomes active, but the grammar consuming it remains disabled because lang/tags/keywords.talon requires user.code_keywords and the only repository context enabling that tag is lang/csharp/csharp.talon, which matches only csharp. Consequently keyword public and the other new mappings are unavailable in the Razor context despite this header explicitly targeting it.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lines/50-199 Pull request changes 50 to 199 lines review/updated-after-changes-requested New commits were pushed after changes were requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants