Skip to content

Conversation

InsertCreativityHere
Copy link
Member

@InsertCreativityHere InsertCreativityHere commented Aug 22, 2025

I manually reviewed every single doc-comment in every Slice file.
Originally I was just fixing #4329 (which this PR does), by adding links to places where AUTOLINK used to.

But I also came across lots of bad formatting, incorrect comments, and bad grammar.
So I ended up just fixing everything.

I tried using Copilot on the larger files (Contract.ice, Admin.ice), but it goes too crazy rewriting sentences instead of just fixing objective mistakes. Unfortunate.


module IceGrid
{
// This class is no longer used. We keep it only for interop with IceGrid 3.7.
Copy link
Member Author

Choose a reason for hiding this comment

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

This comment says the class is only for interop, and it's not even a doc-comment.
So I marked this deprecated to signal that it shouldn't be used for new projects.

Is this fine? Or should it be left un-deprecated so users don't see deprecation warnings?

Copy link
Member

Choose a reason for hiding this comment

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

You're editing Internal.ice. It's not a public file.

InternalAdapterDescriptorSeq adapters;

// Not used, always empty. Kept only for interop with IceGrid 3.7.
InternalDbEnvDescriptorSeq dbEnvs;
Copy link
Member Author

Choose a reason for hiding this comment

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

Same idea: should this stay undeprecated even if it's never used anymore?

Copy link
Member

Choose a reason for hiding this comment

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

Same feedback: since it's Internal, the deprecated is only going to affect internal code. You may need to update some code to turn-off these warnings.

Comment on lines +113 to +115
/// Activate this adapter. If this adapter can be activated, this will activate the adapter and return the
/// direct proxy of the adapter once it's active. If this adapter can be activated on demand, this will return
/// `null` if the adapter is inactive or the adapter direct proxy it's active.
Copy link
Member Author

Choose a reason for hiding this comment

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

  1. These lines were over the 120 column limit.
  2. this will return 0 is impossible. I'm just hoping we meant null here.

Comment on lines +125 to +126
/// @param proxy The direct proxy.
/// The direct proxy should be created with the object adapter and should contain the object adapter endpoints.
Copy link
Member Author

Choose a reason for hiding this comment

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

Also over the 120 column limit.

interface Node extends FileReader, ReplicaObserver
{
/// Load the given server. If the server resources weren't already created (database environment directories,
/// property files, etc), they will be created. The returned proxy is never null.
Copy link
Member Author

Choose a reason for hiding this comment

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

No idea where there's extra indentation here.
Removed.


/// Called to accept an invitation into the given group.
/// @param j The id of the node accepting the invitation.
/// @param observer The observer.
Copy link
Member Author

Choose a reason for hiding this comment

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

Also out of order here.

/// @return The replica proxy, or `null` if this instance is not replicated.
["cpp:const"] idempotent IceStormElection::Node* getReplicaNode();
}
} // End module IceStorm
Copy link
Member Author

Choose a reason for hiding this comment

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

Why even comment this?
Deleted.

Copy link
Member

Choose a reason for hiding this comment

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

It's common in C++, especially when using the same indentation level for several constructs (namespace, class).

Now that we use a nicer indentation for Slice, it's not helpful

# globally by setting AUTOLINK_SUPPORT to NO.
# The default value is: YES.

AUTOLINK_SUPPORT = YES
Copy link
Member Author

Choose a reason for hiding this comment

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

Disable AUTOLINKing in Slice.


module Test2
{
/**
Copy link
Member Author

Choose a reason for hiding this comment

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

This shouldn't be a doc-comment.
It's /* in ever of language's operation/Test.ice file.

/// If a non-null session proxy is returned, it must be configured to route through the router that created it.
/// This occurs automatically when the router is configured as the client's default router at the time the
/// session proxy is created in the client application; otherwise, the client must configure the session proxy
/// explicitly.
Copy link
Member Author

Choose a reason for hiding this comment

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

Normally we place @see after the operation tags.

string reason;
}

/// The exception that is thrown when a server failed to start.
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a bad copy-paste from ServerStartException directly above here.

@InsertCreativityHere InsertCreativityHere marked this pull request as ready for review August 22, 2025 16:07
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 comprehensively reviews and fixes all doc-comments in Slice files across the codebase. The primary purpose is to address issue #4329 by adding proper links where AUTOLINK was previously used, while also correcting formatting errors, grammatical mistakes, and inconsistent documentation throughout.

Key changes include:

  • Replacement of implicit references with proper {@link} syntax for cross-references
  • Correction of parameter references using @p notation
  • Fix of grammatical errors and formatting inconsistencies

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
swift/test/Ice/hold/Test.ice Updated parameter references and method names in code blocks
slice/IceStorm/IceStorm.ice Added link formatting and corrected parameter references
slice/IceLocatorDiscovery/Lookup.ice Enhanced cross-references with proper link syntax
slice/IceGrid/Session.ice Improved parameter references and cross-links
slice/IceGrid/Registry.ice Minor wording improvements for consistency
slice/IceGrid/FileParser.ice Enhanced cross-reference formatting
slice/IceGrid/Exception.ice Fixed incorrect exception description
slice/IceGrid/Descriptor.ice Added sequence type links and formatting fixes
slice/IceGrid/Admin.ice Improved formatting and cross-references
slice/IceDiscovery/Lookup.ice Enhanced interface references with proper links
slice/Ice/Router.ice Grammar and formatting improvements
slice/Ice/RemoteLogger.ice Enhanced cross-references and parameter formatting
slice/Ice/Metrics.ice Corrected pluralization and parameter references
slice/Ice/LocatorRegistry.ice Enhanced cross-references and parameter formatting
slice/Ice/Locator.ice Removed redundant link formatting
slice/Ice/Context.ice Minor grammar correction
slice/Glacier2/Session.ice Grammar fixes and enhanced cross-references
slice/Glacier2/Router.ice Reorganized see-also references
slice/Glacier2/PermissionsVerifier.ice Grammar correction
js/test/Ice/operations/Test.ice Changed multi-line to single-line comment
java/test/src/main/java/test/Ice/location/Test.ice Pluralization fix
java/test/src/main/java/test/Ice/hold/Test.ice Parameter and method reference improvements
doxygen/Doxyfile Disabled AUTOLINK_SUPPORT
csharp/test/Ice/hold/Test.ice Parameter and method reference improvements
cpp/test/Ice/hold/Test.ice Parameter and method reference improvements
cpp/src/IceStorm/LinkRecord.ice Enhanced cross-references
cpp/src/IceStorm/IceStormInternal.ice Comprehensive formatting and reference improvements
cpp/src/IceStorm/Election.ice Parameter reordering and formatting fixes
cpp/src/IceGrid/Internal.ice Extensive formatting and reference improvements
cpp/src/DataStorm/Contract.ice Enhanced cross-references and formatting
cpp/include/Ice/ObjectAdapter.h Comment formatting fix
cpp/include/DataStorm/Node.h Comment formatting fix

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


/// The exception that is thrown when a server failed to start.
/// The exception that is thrown when a server failed to stop.
exception ServerStopException
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

The comment describes an exception for when a server failed to stop, but the exception name is ServerStopException. This is contradictory - if this exception is thrown when a server failed to stop, it should be named something like ServerStopFailedException. Either the comment or the exception name is incorrect.

Suggested change
exception ServerStopException
exception ServerStopFailedException

Copilot uses AI. Check for mistakes.

interface SubscriberSession extends Session
{
/// Queue a sample with the subscribers of the topic element.
/// Queue a @p sample with the subscribers of the topic element.
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be either "queue @p sample" or "queue a sample", not a mix of both.

Also, all these purely internal doc-comments aren't that important.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

/// The lookup interface is used by DataStorm nodes to announce their topic readers and writers to other connected
/// nodes. When multicast is enabled, the lookup interface also broadcasts these announcements.
/// Each DataStorm node hosts a lookup servant with the identity "DataStorm/Lookup".
/// Each DataStorm node hosts a lookup servant with the identity `'DataStorm/Lookup'`.
Copy link
Member

Choose a reason for hiding this comment

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

A code span without quotes is sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I updated all our identity examples to just use a code-span with nothing else.


module IceGrid
{
// This class is no longer used. We keep it only for interop with IceGrid 3.7.
Copy link
Member

Choose a reason for hiding this comment

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

You're editing Internal.ice. It's not a public file.

InternalAdapterDescriptorSeq adapters;

// Not used, always empty. Kept only for interop with IceGrid 3.7.
InternalDbEnvDescriptorSeq dbEnvs;
Copy link
Member

Choose a reason for hiding this comment

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

Same feedback: since it's Internal, the deprecated is only going to affect internal code. You may need to update some code to turn-off these warnings.

/// @param gn The group name.
/// @param j The group coordinator.
/// @param gn The group name.
void invitation(int j, string gn);
Copy link
Member

Choose a reason for hiding this comment

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

And Slice compiler did not issue a warning?

/// @return The replica proxy, or `null` if this instance is not replicated.
["cpp:const"] idempotent IceStormElection::Node* getReplicaNode();
}
} // End module IceStorm
Copy link
Member

Choose a reason for hiding this comment

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

It's common in C++, especially when using the same indentation level for several constructs (namespace, class).

Now that we use a nicer indentation for Slice, it's not helpful

/// @param proxy A proxy to the {@link Process} object of the server. This proxy is never null.
/// @throws ServerNotFoundException Thrown when the locator does not know a server application with this server
/// ID.
/// @p id.
Copy link
Member

Choose a reason for hiding this comment

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

should be "with server ID @p id".

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. I see what you mean.

throws UnknownMetricsView;

/// Gets the metrics objects for the given metrics view.
/// Gets the metrics objects for the given metrics @p view.
Copy link
Member

Choose a reason for hiding this comment

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

Should be: "... for the metrics view @p view"

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. Felt more natural to remove the @p here.

throws UnknownMetricsView;

/// Gets the metrics failures associated with the given view and map.
/// Gets the metrics failures associated with the given @p view and @p map.
Copy link
Member

Choose a reason for hiding this comment

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

I'd remove "given". You mark them as parameters, they are clearly "given".

Copy link
Member Author

Choose a reason for hiding this comment

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

We use 'given' all the time in our Slice files, so I'm going to leave it for now to get this merged.
Can always re-review all our comments again in the future.

interface LoggerAdmin
{
/// Attaches a RemoteLogger object to the local logger. This operation calls {@link RemoteLogger#init} on @p prx.
/// Attaches a {@link RemoteLogger} object to the local logger. This operation calls {@link RemoteLogger#init}
Copy link
Member

Choose a reason for hiding this comment

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

I thought operation-referencing syntax was "::", not "#".

You use both in this PR. Are they both correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Doxygen supports # anywhere where :: can appear but not the other way.
So, this does work, but we really should use :: for operations. This one just slipped by me.

Fixed.

@bernardnormier bernardnormier self-requested a review August 25, 2025 15:24
@InsertCreativityHere InsertCreativityHere merged commit 7337ce1 into zeroc-ice:main Aug 25, 2025
26 of 28 checks passed
pepone pushed a commit to pepone/ice that referenced this pull request Sep 16, 2025
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