Page MenuHomePhabricator

Truncate long source lines in Paste search result list snippets
ClosedPublic

Authored by gd on Oct 20 2015, 4:30 PM.
Tags
None
Referenced Files
F14052980: D14313.diff
Fri, Nov 15, 11:52 AM
F14039950: D14313.diff
Mon, Nov 11, 6:51 AM
F14024588: D14313.diff
Thu, Nov 7, 10:58 AM
F14013028: D14313.diff
Fri, Nov 1, 11:31 PM
F14006032: D14313.id34550.diff
Sun, Oct 27, 11:41 PM
F13993327: D14313.id34551.diff
Tue, Oct 22, 10:10 PM
Unknown Object (File)
Oct 9 2024, 2:36 AM
Unknown Object (File)
Oct 4 2024, 1:48 PM
Subscribers

Details

Summary

An attempt to resolve T9600.

  • PhabricatorPasteQuery builds truncated snippet when requested using needSnippet().
  • PhabricatorPasteSearchEngine uses Paste snippet istead of content.
  • PhabricatorSourceCodeView accepts truncated source and type instead of line limit.
Test Plan

Generated some content for Paste application and also added huge JSON oneliner. Checked Paste application pages in browser.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gd retitled this revision from to Truncate long source lines in Paste search result list snippets.
gd updated this object.
gd edited the test plan for this revision. (Show Details)
gd added a reviewer: epriestley.
epriestley edited edge metadata.

Seems reasonable as a step forward to me, thanks! A couple minor inlines. You should have commit access now.

src/applications/paste/query/PhabricatorPasteQuery.php
51

For consistency, prefer needSnippets() over needSnippet() (i.e., plural) -- Query classes load multiple objects in the general case.

292

Prefer phutil_json_decode().

328

Prefer phutil_json_encode().

This revision is now accepted and ready to land.Oct 20 2015, 4:38 PM
This revision was automatically updated to reflect the committed changes.
gd marked 3 inline comments as done.