Skip to content

add:did-create/rename/delete#21

Merged
ufo5260987423 merged 4 commits intoMoganLab:mainfrom
VSteveHL:ospp-xmain-sync
Jul 14, 2025
Merged

add:did-create/rename/delete#21
ufo5260987423 merged 4 commits intoMoganLab:mainfrom
VSteveHL:ospp-xmain-sync

Conversation

@VSteveHL
Copy link
Collaborator

sync from xmain

fix

fix

fix:server capability

fix:please refer the comment in scheme-langserver.sls

test:did-create/delete

test:did-create/delete

fix:please refer the comment in scheme-langserver.sls

fix

fix

fix

fix

fix

fix
@VSteveHL VSteveHL requested a review from Copilot July 11, 2025 16:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for workspace file-change notifications (create, rename, delete) by syncing handlers from xmain and updating tests.

  • Introduces JSON fixtures and test integration for did-create and did-delete events.
  • Registers new workspace file operations in the server and implements corresponding handlers.
  • Refactors workspace initialization with filter facets and adds helper functions for attaching/removing files.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/resources/did-delete.json New fixture for workspace/didDeleteFiles
tests/resources/did-create.json New fixture for workspace/didCreateFiles
tests/protocol/apis/test-file-change-notification.sps Test script updated to send did-delete and did-create notifications
tests/analysis/test-workspace.sps Updated init-workspace test to use txt filter in resources path
scheme-langserver.sls Registered handlers and capabilities for file-change notifications
protocol/apis/file-change-notification.sls Added did-create, did-rename, did-delete implementations
analysis/workspace.sls Refactored init-workspace to use facets; added attach/remove helpers
analysis/package-manager/txt-filter.sls Simplified generate-txt-file-filter signature and logic
Comments suppressed due to low confidence (2)

protocol/apis/file-change-notification.sls:69

  • [nitpick] The parameter name siblins is misspelled and can be misleading; consider renaming it to sibling or sibling-node for clarity.
              (lambda (siblins)

tests/protocol/apis/test-file-change-notification.sps:53

  • There’s no test coverage for the new workspace/didRenameFiles handler. Consider adding a did-rename JSON fixture, header block, and corresponding assertions to this test.
                    did-delete-header did-delete-json

(define (remove-new-file path parent my-filter)
(let ([f (walk-file parent path)])
(cond
[(not (null? f)) '()]
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

The early-return condition in remove-new-file is inverted: it currently returns immediately when f is found and only removes children when f is absent. Swap the branches so that when f is null you return, otherwise proceed to remove the node.

Suggested change
[(not (null? f)) '()]
[(null? f) '()]

Copilot uses AI. Check for mistakes.
Comment on lines +249 to +267
(define (remove-new-file path parent my-filter)
(let ([f (walk-file parent path)])
(cond
[(not (null? f)) '()]
[else
(file-node-children-set!
(file-node-parent f)
(filter
(lambda (x) (not (equal? x f)))
(file-node-children (file-node-parent f))))])))

(define (attach-new-file path parent my-filter)
(let ([f (walk-file parent path)])
(cond
[(not (my-filter path)) '()]
[(not (file-exists? path)) '()]
[(not (null? f)) f]
[(file-node-folder? parent)
(let ([maybe-parent
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

remove-new-file is defined but never used; either remove this function to reduce dead code or integrate it into did-delete for consistency.

Suggested change
(define (remove-new-file path parent my-filter)
(let ([f (walk-file parent path)])
(cond
[(not (null? f)) '()]
[else
(file-node-children-set!
(file-node-parent f)
(filter
(lambda (x) (not (equal? x f)))
(file-node-children (file-node-parent f))))])))
(define (attach-new-file path parent my-filter)
(let ([f (walk-file parent path)])
(cond
[(not (my-filter path)) '()]
[(not (file-exists? path)) '()]
[(not (null? f)) f]
[(file-node-folder? parent)
(let ([maybe-parent
;; Logic from `remove-new-file` integrated into `did-delete` function.
;; Remove the `remove-new-file` function entirely.

Copilot uses AI. Check for mistakes.
@ufo5260987423 ufo5260987423 merged commit 91c10e5 into MoganLab:main Jul 14, 2025
1 check passed
@VSteveHL VSteveHL deleted the ospp-xmain-sync branch July 14, 2025 14:40
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