Skip to content

Conversation

suzuki
Copy link
Contributor

@suzuki suzuki commented Sep 18, 2025

Summary

  • Extracts hardcoded major modes list to a customizable variable lsp-graphql-activated-modes
  • Allows users to extend or modify which modes can trigger GraphQL LSP activation
  • Maintains backward compatibility with default modes (js-mode, js2-mode, typescript-mode, typescript-ts-mode)

Motivation

I wanted to disable lsp-graphql activation in typescript-ts-mode but there was no way to do it. The major modes were hardcoded in the activation function. This change makes it easier for users to control which modes activate the GraphQL language server by providing a customizable variable.

Changes

  • Added new defcustom lsp-graphql-activated-modes with the list of major modes
  • Updated lsp-graphql-activate-p to use the customizable list via apply
  • Added comprehensive docstring explaining the purpose of the variable
  • Removed unnecessary json-mode exclusion logic (now controlled through the customizable list)

@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 11:28
Copy link

@Copilot 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

This PR extracts hardcoded major modes for GraphQL LSP activation into a customizable variable, improving configuration flexibility while maintaining backward compatibility.

  • Introduces lsp-graphql-activated-modes defcustom to replace hardcoded mode list
  • Updates activation logic to use the configurable variable instead of fixed mode names
  • Preserves existing default behavior with js-mode, js2-mode, typescript-mode, and typescript-ts-mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added the client One or more of lsp-mode language clients label Sep 18, 2025
@suzuki suzuki marked this pull request as draft September 18, 2025 21:34
Make the list of major modes that can activate the GraphQL language
server configurable via `lsp-graphql-activated-modes` custom variable.
This allows users to extend or modify which modes can trigger GraphQL
LSP activation without modifying the source code.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@suzuki suzuki force-pushed the extract-lsp-graphql-modes-to-defcustom branch from d095b25 to 15edabf Compare September 27, 2025 01:41
@suzuki suzuki marked this pull request as ready for review September 27, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant