Skip to content

Release 0.1.4 #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 24, 2025
Merged

Release 0.1.4 #27

merged 8 commits into from
Apr 24, 2025

Conversation

FoxKiana
Copy link
Contributor

@FoxKiana FoxKiana commented Apr 20, 2025

Fixes

  • Fixed doc comments not finding macro parameters
  • Fixed doc comment completions
  • Fixed IDE error caused by doc comment not finding underlying function or macro
  • Fixed doc comment not finding underlying function or macro when in default module
  • Fixed top level code completion interfering with doc comments
  • Fixed hover doc displaying parameters that only existed in the doc comment

Additions

  • Added hover doc for macros
  • Added doc comment description to hover doc
  • Added inspection for missing imports
  • Added inspection for missing functions or macro in imports
  • Added stdlib path selector in both project wizards
  • Added banner that shows if the stdlib path couldn't be detected
  • Added string highlighting in doc comments for all strings
  • Added settings page
  • Added styled parameter names in doc comments

Optimizations

  • Optimized stdlib path lookup by the IDE
  • Optimized code completion by implementing new completion system

Necessary tests

  • this code must behave according to the comments
/*
   highlighting and doc should also be fine in default module
*/
<*
   This comment should also appear in the hover doc

   @param list   : "the list to search"
   @param lookup : "the number to search for"
   @param error  : "this should highlight as an error since the param doesn't exist"
   @return         "true if the number could be found in the list"
*>
fn bool test_function(int[] list, int lookup)
{
    foreach (i : list)
    {
        if (i == lookup) return true;
    }

    return true;
}

<*
   This comment should also appear in the hover doc

   @param list   : "the list to search"
   @param lookup : "the number to search for"
   @param error  : "this should highlight as an error since the param doesn't exist"
   @return         "true if the number could be found in the list"
*>
macro bool test_macro(list, lookup)
{
    foreach (i : list)
    {
        if (i == lookup) return true;
    }

    return true;
}

module main;

/*
   method to run the project and check for run errors
*/
fn void main() {}

module test_missing_import;

/*
   this should highlight the call as a warning since no suitable
   import was found
*/
fn void test_missing_import()
{
    io::printn("Test");
}

module test_missing_function_in_module;

import std::io;

/*
   this should highlight the call as a warning since no suitable
   function or macro was found in the module
*/
fn void test_missing_function_in_import()
{
    io::error("Test");
}

module test_hover_doc_for_functions_and_macros;

/*
   this should display the doc comment and the contracts listed
   in the comment nicely organized on hover
*/

<*
   This comment should also appear in the hover doc

   @param list   : "the list to search"
   @param lookup : "the number to search for"
   @param error  : "this should highlight as an error since the param doesn't exist"
   @return         "true if the number could be found in the list"
*>
fn bool test_function(int[] list, int lookup)
{
    foreach (i : list)
    {
        if (i == lookup) return true;
    }

    return true;
}

<*
   This comment should also appear in the hover doc

   @param list   : "the list to search"
   @param lookup : "the number to search for"
   @param error  : "this should highlight as an error since the param doesn't exist"
   @return         "true if the number could be found in the list"
*>
macro bool test_macro(list, lookup)
{
    foreach (i : list)
    {
        if (i == lookup) return true;
    }

    return true;
}

Test checks

  • test_missing_function_in_import
  • test_missing_function_in_module
  • test_hover_doc_for_functions_and_macros
  • see if path selector is present in both project wizards
  • see if the banner displays in case of c3c not being installed or not being able to locate the stdlib path
  • see if all strings in doc comments have correct highlighting
  • see if the completion in doc comments works properly and only suggests at appropriate sections/parts of the comment
  • see if the parameter names in doc comments have a unique styling
  • see if settings page in Languages & Frameworks shows and has the correct data displayed

TESTED SYSTEMS

  • tested on windows
  • tested on linux
  • tested on darwin

DO NOT MERGE UNTIL ALL BOXES ARE CHECKED AND ALL TESTS HAVE BEEN MARKED AS COMPLETED, ADDITIONALLY THESE FEATURES SHOULD BE TESTED BY AT LEAST 2 PEOPLE ON 2 DIFFERENT OPERATING SYSTEMS TO ASSURE CROSS-COMPATIBILITY WITH SOME FEATURES

@FoxKiana
Copy link
Contributor Author

FoxKiana commented Apr 20, 2025

Fix list

  • Fix stdlibPath possibly being null
  • Fix inspection not checking for same-module function or macro calls
  • remove need for module prefix when calling a builtin function or macro MOVED TO 0.1.5
  • Make Inspection display the module name of the guessed function/macro name if in a different module
  • fix doc comment not allowing parameter names starting with # or $
  • fix stdlib opath not properly being detected on windows

## Fixes
- Fixed doc comments not finding macro parameters
- Fixed doc comment completions
- Fixed IDE error caused by doc comment not finding underlying function or macro
- Fixed doc comment not finding underlying function or macro when in default module
- Fixed top level code completion interfering with doc comments
- Fixed hover doc displaying parameters that only existed in the doc comment

## Additions
- Added hover doc for macros
- Added doc comment description to hover doc
- Added inspection for missing imports
- Added inspection for missing functions or macro in imports
- Added stdlib path selector in both project wizards
- Added banner that shows if the stdlib path couldn't be detected
- Added string highlighting in doc comments for all strings
- Added settings page
- Added styled parameter names in doc comments

## Optimizations
- Optimized stdlib path lookup by the IDE
- Optimized code completion by implementing new completion system
- Fixed stdlibPath possibly being null
- Fixed inspection not checking for same module functions or macros
- Fixed inspection not displaying the call module
- Fixed doc comment not allowing parameters starting with `#` or `$`
- Fixed inspection wrongfully annotating correct function call as not found
- Fixed stdlib path not being correctly detected on windows
- Fixed Macro doc comment expecting a set return type
- Fixed inspection wrongfully assuming some elements as call expressions
@lerno lerno merged commit 7b8e7ed into c3lang:master Apr 24, 2025
1 of 2 checks passed
@FoxKiana FoxKiana mentioned this pull request Apr 24, 2025
32 tasks
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