-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
📦 Update unknownutil to v4 #393
Conversation
WalkthroughThe recent updates across several files enhance type validation and error handling by upgrading imports from the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant System
participant ErrorHandler
participant Validator
User->>System: Invoke method
System->>Validator: Validate input
Validator-->>System: Return validation result
alt Valid
System->>User: Return result
else Invalid
System->>ErrorHandler: Handle error
ErrorHandler-->>System: Return error response
System->>User: Show error message
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- denops/@denops-private/denops.ts (1 hunks)
- denops/@denops-private/error.ts (2 hunks)
- denops/@denops-private/error_test.ts (1 hunks)
- denops/@denops-private/host.ts (2 hunks)
- denops/@denops-private/host/nvim.ts (3 hunks)
- denops/@denops-private/host/vim.ts (2 hunks)
- denops/@denops-private/host_test.ts (1 hunks)
- denops/@denops-private/util.ts (1 hunks)
- denops/@denops-private/version_test.ts (1 hunks)
- denops/@denops-private/worker.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- denops/@denops-private/host_test.ts
Additional context used
Learnings (1)
denops/@denops-private/host/nvim.ts (1)
Learnt from: Milly PR: vim-denops/denops.vim#352 File: denops/@denops-private/testutil/host.ts:3-4 Timestamp: 2024-05-25T06:35:34.785Z Learning: `Neovim` and `Vim` from `../host/nvim.ts` and `../host/vim.ts` are classes and should be imported normally if they are instantiated in the code.
Additional comments not posted (15)
denops/@denops-private/util.ts (2)
2-5
: LGTM! Imports updated correctly.The import statements have been updated to use the new version of
unknownutil
, which is correct and aligned with the new version of the library.
7-11
: LGTM! Implementation updated correctly.The
isMeta
constant has been updated to use the new utility functions fromunknownutil
, which enhances type safety and clarity.denops/@denops-private/error.ts (2)
1-1
: LGTM! Import updated correctly.The import statement has been updated to use
isString
from the new version ofunknownutil
, which is correct and aligned with the new version of the library.
Line range hint
19-25
:
LGTM! Function updated correctly.The
errorDeserializer
function has been updated to useisString
, which enhances clarity and specificity in type checking.denops/@denops-private/error_test.ts (1)
2-2
: LGTM! Import updated correctly.The import statement has been updated to use the new version of
unknownutil
, which is correct and aligned with the new version of the library.denops/@denops-private/denops.ts (2)
3-6
: LGTM! Imports updated for specific utility functions.The import statements have been updated to use specific utility functions from
unknownutil
version 4. This enhances clarity and potentially optimizes the code by only importing the necessary functions.
10-10
: LGTM! Type validation logic updated.The type validation logic for
isBatchReturn
has been updated to use the new imports. This improves readability and aligns with the latest utility functions.denops/@denops-private/version_test.ts (1)
4-4
: LGTM! Import statement updated forPredicate
.The import statement for
Predicate
has been updated to useunknownutil
version 4. This change ensures compatibility with the latest version of the library.denops/@denops-private/worker.ts (1)
8-8
: LGTM! Import statement updated forensure
.The import statement for
ensure
has been updated to useunknownutil
version 4. This change enhances flexibility and ensures compatibility with the latest version of the library.denops/@denops-private/host.ts (2)
1-7
: LGTM! Import statements are correctly updated.The import statements have been updated to use specific utility functions from
unknownutil
version^4.0.0
. This change enhances modularity and clarity.
103-111
: LGTM! Predicates are correctly updated.The predicates in
serviceMethodArgs
have been updated to use new utility functions. This change enhances type safety and maintainability.denops/@denops-private/host/vim.ts (2)
1-6
: LGTM! Import statements are correctly updated.The import statements have been updated to use specific utility functions from
unknownutil
version^4.0.0
. This change enhances modularity and clarity.
128-138
: LGTM! Type-checking functions are correctly updated.The type-checking functions have been updated to use new utility functions. This change enhances type safety and maintainability.
denops/@denops-private/host/nvim.ts (2)
1-7
: LGTM! Import statements are correctly updated.The import statements have been updated to use specific utility functions from
unknownutil
version^4.0.0
. This change enhances modularity and clarity.
139-148
: LGTM! Type-checking functions are correctly updated.The type-checking functions have been updated to use new utility functions. This change enhances type safety and maintainability.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #393 +/- ##
==========================================
+ Coverage 95.45% 95.52% +0.06%
==========================================
Files 23 23
Lines 1363 1384 +21
Branches 174 174
==========================================
+ Hits 1301 1322 +21
Misses 59 59
Partials 3 3 ☔ View full report in Codecov by Sentry. |
a00f8a2
to
f0e03ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- denops/@denops-private/denops.ts (1 hunks)
- denops/@denops-private/error.ts (2 hunks)
- denops/@denops-private/error_test.ts (3 hunks)
- denops/@denops-private/host.ts (2 hunks)
- denops/@denops-private/host/nvim.ts (3 hunks)
- denops/@denops-private/host/vim.ts (2 hunks)
- denops/@denops-private/host_test.ts (1 hunks)
- denops/@denops-private/util.ts (1 hunks)
- denops/@denops-private/version_test.ts (2 hunks)
- denops/@denops-private/worker.ts (1 hunks)
Files skipped from review due to trivial changes (3)
- denops/@denops-private/host.ts
- denops/@denops-private/host_test.ts
- denops/@denops-private/worker.ts
Files skipped from review as they are similar to previous changes (6)
- denops/@denops-private/denops.ts
- denops/@denops-private/error.ts
- denops/@denops-private/error_test.ts
- denops/@denops-private/host/vim.ts
- denops/@denops-private/util.ts
- denops/@denops-private/version_test.ts
Additional comments not posted (3)
denops/@denops-private/host/nvim.ts (3)
1-7
: LGTM! Improved modularity and performance.The updated import statements enhance modularity and performance by importing only the necessary functions from
unknownutil
version 4.0.0.
36-37
: LGTM! Improved code clarity.The updated usage of the
ensure
function aligns with the new modular structure of theunknownutil
library and improves code clarity.
139-139
: LGTM! Enhanced consistency and readability.The updated constants utilize the new function imports, enhancing consistency and readability in type-checking.
Also applies to: 142-148
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- denops/@denops-private/denops.ts (1 hunks)
- denops/@denops-private/error.ts (2 hunks)
- denops/@denops-private/error_test.ts (3 hunks)
- denops/@denops-private/host/nvim.ts (3 hunks)
- denops/@denops-private/host/vim.ts (2 hunks)
- denops/@denops-private/host_test.ts (1 hunks)
- denops/@denops-private/util.ts (1 hunks)
- denops/@denops-private/version_test.ts (2 hunks)
- denops/@denops-private/worker.ts (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- denops/@denops-private/denops.ts
- denops/@denops-private/error.ts
- denops/@denops-private/error_test.ts
- denops/@denops-private/host_test.ts
- denops/@denops-private/util.ts
- denops/@denops-private/version_test.ts
- denops/@denops-private/worker.ts
Additional comments not posted (10)
denops/@denops-private/host/vim.ts (5)
1-6
: LGTM! Imports are correctly updated.The import statements have been correctly updated to use specific paths from the
unknownutil
library version 4.
Line range hint
41-44
:
LGTM! Usage ofensure
withisCallReturn
is correct.The function
call
correctly uses theensure
function with theisCallReturn
type check.
Line range hint
54-57
:
LGTM! Usage ofensure
withisBatchReturn
is correct.The function
batch
correctly uses theensure
function with theisBatchReturn
type check.
Line range hint
95-109
:
LGTM! Usage ofisVoidMessage
andisInvokeMessage
is correct.The function
#dispatch
correctly uses theisVoidMessage
andisInvokeMessage
type checks.
128-138
: LGTM! Constants are correctly defined.The constants
isCallReturn
,isBatchReturn
,isVoidMessage
, andisInvokeMessage
are correctly defined using specific type-checking functions from theunknownutil
library version 4.denops/@denops-private/host/nvim.ts (5)
1-7
: LGTM! Imports are correctly updated.The import statements have been correctly updated to use specific paths from the
unknownutil
library version 4.
36-37
: LGTM! Usage ofensure
withisString
andisArray
is correct.The
invoke
method in the dispatcher correctly uses theensure
function with theisString
andisArray
type checks.
Line range hint
74-79
:
LGTM! Usage ofisNvimErrorObject
is correct.The function
call
correctly uses theisNvimErrorObject
type check.
Line range hint
88-97
:
LGTM! Usage ofensure
withisNvimCallAtomicReturn
is correct.The function
batch
correctly uses theensure
function with theisNvimCallAtomicReturn
type check.
139-148
: LGTM! Constants are correctly defined.The constants
isNvimErrorObject
andisNvimCallAtomicReturn
are correctly defined using specific type-checking functions from theunknownutil
library version 4.
957ff32
to
56debde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- denops/@denops-private/denops.ts (1 hunks)
- denops/@denops-private/error.ts (2 hunks)
- denops/@denops-private/error_test.ts (3 hunks)
- denops/@denops-private/host.ts (2 hunks)
- denops/@denops-private/host/nvim.ts (3 hunks)
- denops/@denops-private/host/vim.ts (2 hunks)
- denops/@denops-private/host_test.ts (1 hunks)
- denops/@denops-private/util.ts (1 hunks)
- denops/@denops-private/version_test.ts (2 hunks)
- denops/@denops-private/worker.ts (1 hunks)
Files skipped from review as they are similar to previous changes (10)
- denops/@denops-private/denops.ts
- denops/@denops-private/error.ts
- denops/@denops-private/error_test.ts
- denops/@denops-private/host.ts
- denops/@denops-private/host/nvim.ts
- denops/@denops-private/host/vim.ts
- denops/@denops-private/host_test.ts
- denops/@denops-private/util.ts
- denops/@denops-private/version_test.ts
- denops/@denops-private/worker.ts
SSIA
Summary by CodeRabbit
New Features
unknownutil
library, enhancing type safety.Bug Fixes
errorDeserializer
function by using more specific type checks.Documentation
unknownutil
module to^4.0.0
across all relevant files, allowing access to new features and optimizations.Refactor