Skip to content

[BUG]: Spell checking features for C #257

@zbreit

Description

@zbreit

Issue Description

Code Book does not currently spell-check the following C-language features:

// Macro functions and parameters
#define MACRO_FUNCTION(macro_param) macro_param + 1

// Named unions
union MyUnion {};

// Array declarations and fields
int nums[20];
struct { int ages[20]; };

// String content (other than function calls and initializers)
char* string;
string = "start\nthis should be spell-checked" "and so should this";

Operating System

Linux (Arch)

Editor

Zed

Codebook Version

0.3.38

Configuration

N/A

Steps to Reproduce

  1. Create a C language file.
  2. Copy the following snippet:
#define MACRO_FUNCTIONN(macro_paramm) macro_paramm + 1

union MyUnionn {};

int numss[20];
struct MyStruct { int agess[20]; };

char* str = "startt\nthiss shouldd bee spell-checked" "and so should thiss";

void foo() {
   str = "helooo";
}

Expected Behavior

Get spell check warnings for the following words:

  • FUNCTIONN
  • paramm
  • Unionn
  • numss
  • agess
  • startt
  • thiss
  • shouldd
  • thiss
  • helooo

Actual Behavior

No warnings appear.

Code Sample

See snippet above.

Log Output

N/A

Additional Context

Eventually, these fixes will also need to be ported to C++, but I can open a separate issue for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions